Mobile only ad

Posted in: Newspaper
Post count: 23

Hi,
I want to place an custom ad on posts between social sharing and related post on my site (http://soutaoboa.com/as-vezes-um-carinho-cai-tao-bem/). But this one ad should only be visible to mobile visitors.

So:
I have a custom ad 1 and the code is in place (not adsense);
Did a call for the shortcode:
<?php echo do_shortcode(‘[td_block_ad_box spot_id="custom_ad_1"]‘)?> on loop-single file;
On the style.css I have:

@media
only screen and (max-width: 767px) {
.td-a-rec-id-custom_ad_1{
position:center!important;
};
The problem is that the ad is there but visible to everyone.

What I’m doing wrong?
Thanks
P.S. I have a child theme.

Post count: 22421

Hello,
If you use a custom ad, please only use this method and only use the div’s for the mobile version:
https://forum.tagdiv.com/using-other-ads/
Hope this helps.
Thank you!

Post count: 23

Hi Bogdan,
Thanks for your answer. I’ve followed the instructions that you gave and I was able to place the ad only on mobile.
However isn’t in my desired place. I want to place him between the social share and related articles (number 2 in screenshot) but the ad shows below the related articles (1).
In the screenshot is my shortcode call in the loop-single file.
It’s possible to place it where I want it?

Post count: 22421

Hello,
You can place the do_shortcode function anywhere you want in the file and test it out. It should work in all places if it’s added properly.
Thank you!

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