How to turn off Header Ad in some post?

Posted in: Newspaper
Post count: 28

Also How to write subtitle post text?

Post count: 20688

Hi,

The theme doesn’t have such a setting, the ad will be displayed permanently. Usually this could be done with CSS but in case of Adsense ads Google will not allow them to be hidden with CSS.

You could create a condition in the header template 6 file you are using. Something liks in this topic
https://forum.tagdiv.com/topic/my-header-ad-are-not-in-the-middle-of-the-page/

The condition would be – if this is not post IDs -> show the ad
https://www.screencast.com/t/oL6gb45vq
So the ad will not be loaded for those posts.

Or you could try using a plugin such as Adrotate, I believe that has such settings
http://www.wpbeginner.com/plugins/how-to-manage-ads-in-wordpress-with-adrotate-plugin/
https://ajdg.solutions/manuals/adrotate-manuals/

Thanks

Post count: 28

Thank you for your kind reply but I try to add this code that you sent me screen shot but my website goes down and show this msg.

Parse error: syntax error, unexpected ‘{‘, expecting ‘(‘ in /homepages/12/d539825421/htdocs/clickandbuilds/NextLifeStyleTV/wp-content/themes/Newspaper/parts/header/header-style-6.php on line 41

so I replate the backup one and now the website is back.

Please, can you just put this request in your next update theme that in a post like you have other options below so Add options for Ads off on any page or post we want?

Also when you will go to fix the Tagdiv Mobile plugin issue? right now I can’t use the plugin because once I activate the plugin my save theme changes options stuck. so i switch off the tagdiv mobile plugin and all works fine.

Post count: 20688

That could mean the syntax of the code you are entering is not valid, seems to mention an accolade on line 41. You could try again, make sure the code is valid as in my example
https://www.screencast.com/t/BClxC9xDE

Maybe this will be set as an option for the header builder that is being developed at the moment, I can’t say for sure.

Post count: 28

<?php if ( !is_single(arry(‘11386’,”11407″))) locate_template(‘parts/header/ads.php’, true);) ?>

What is wrong in this code? I just wrote as you sent me the picture. but it’s not working?

Post count: 20688

That is not quite right, I will give you the line of code and you can replace it on your end. Here it is
https://pastebin.com/tuWMTefdhttp://prntscr.com/me46vx
Be sure to enter the IDs of the posts in the code, those can be seen while hovering their names in the posts screen – http://prntscr.com/me47mp

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