Don't show ad on a particular page

Posted in: Newspaper
Post count: 48

Hello Tagdiv,
I want the header ad (and the ad banner itself) to not be shown on a particular page created by me.
The theme always applies this area on every page.
How to achieve this?

Post count: 22421

Hi,

There are 2 ways to go about this. If your ad is a custom one and it does not depend on an ad provider such as adsense, then you can simply hide it with css by using the specific page ID: http://screencast.com/t/ETALHowd8
In my case it’s 266 sao I would use css like so:

.page-id-266 .td-a-rec-id-header{
display:none!important;
}
 

If you use an ad provider than hiding it with css will not be the best solution as it will still be detected on that page by the crawler so in this case you need to add a condition in the header style file:
Replace this part: http://screencast.com/t/iuDQSq8DULn with this code and add your own page id to it:

<?php if (!is_page(266)){ locate_template('parts/header/ads.php', true);}?>

Hope this helps.

Thank you!

Post count: 48

Thank you for your help!

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