Sidebar ad unit visible from mobile

Posted in: Newsmag
Post count: 46

I have a wordpress site with 4.4.2 and Newsmag theme 2.2

I want to add a sidebar ad unit to show the ads only on desktop devices, and not on mobile devices.

I’m using td-visible-desktop but still the ad appears on mobile devices as well (towards bottom of the page).

Note : I’m using Google’s new GPT ad tags.

There are two things which we tried to fix the problem:
1. We updated to the new theme v2.3.5 on a test environment and used the GPT ad tags, it worked perfectly fine. Here’s a test site link where it works as expected on mobile and desktop devices : http://work.koimoi.com/box-office/celebrity-battle/shah-rukh-khan-vs-aamir-khan-highest-lifetime-collection/

2. On theme v2.2, we used Google’s old ad (GAM) tags, and the problem got fixed.

We need a solution where we can use GPT tags, on theme v2.2 wherein the sidebar ads are only visible on mobile devices or desktop, basis the class we use i.e. td-visible-desktop or td-visible-phone

Here is a URL for you to refer to as an example : http://www.koimoi.com/bollywood-news/pratyusha-banerjee-suicide-case-court-rejects-rahuls-bail-plea/

On the URL, you will see 4 ads on the sidebar. The second and third ads are coming through Google’s old GAM tags, whereas the fourth ad is coming through Google’s GPT tags.

The second and third ads are not visible on mobile devices when we use td-visible-desktop, but the fourth ad is visible on mobile devices as well, even though we’ve used td-visible-desktop class.

Post count: 6535

Hi

Use this css in theme panel > custom code > custom css:

@media (max-width: 767px){
.td-visible-desktop {
display: none!important;
}
}

Thanks!

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newsmag’ is closed to new topics and replies.