I want to hide ads in certain cases, e.g. if the user has not yet agreed to my privacy policy.
But I’m not sure where the easiest place is for me to put some conditional code, to actually show / hide the ads.
I’d be grateful for any suggestions.
-
This topic was modified 7 years by
alanathome.
Hello alanathome,
Please notice that the special theme area destinated for inserting the Ad Code is placed in the Theme panel, in Ads Section from here -> https://www.screencast.com/t/XTRS3JxQaMHD -> https://www.screencast.com/t/IP0YKPfdJ Also, if you want to add some conditional code for these, you need to edit the Ads.php core file and if you are not aware of the steps which are needed to take in this case, please consider hiring a freelancer/developer to help you because we can’t provide custom services at the moment.
Thanks.
Hi
Thanks for replying so soon.
I’d hoped that there might have been some hooks which would allow me to do that sort of thing without modifying any core files.
(Hopefully things won’t break when there is an update…)
Kind regards
Alan
Hello again
Does the ads.php file only relate to ‘Header ad’?
Where is it best to add conditional code for the ‘Sidebar ad’ and ‘Footer top ad’?
Thanks
Alan
Hello,
Please notice all of these involves doing such additional customizations and we cannot provide something like this at the moment. Depends where exactly you want to display your conditional code, Sidebar or Footer section, sorry! Please keep in mind that we only offer technical support for the actual theme’s settings. The rest are considered additional customizations and we cannot provide something like this at the moment, sorry!
Thanks for the message!
Thanks, I appreciate what you have said.
I do think that having control of when ads are displayed is something you need to think about adding in future.
Legislation such as GDPR makes it preferable (or even essential) to obtain the user’s agreement before certain types of ad are displayed.
The reason I chose the NewsMag theme in the first place was that I thought it had good control over advertising.
I don’t mind having to code this myself, but I wanted to check first, to make sure I wasn’t “reinventing the wheel.”
~Alan