Block cookie Wp Cookie Privacy

Posted in: Newspaper
Post count: 18

Hi to all. I just installed the newspaper theme. I installed also a plugin (wp cookie privacy) to block script google adsense( european cookie law) with a shortcode but it doesn’t work in your theme.
Usually i use this:

[shortcode privacy block]
<script adsense>
[/shortcode privacy block]
but it does’nt work.

can you explain me how i can do that?
thanks

Post count: 22421

Hello,

Unfortunately we cannot offer a precise answer as the plugin is not tested and we have no idea of it’s functionality. You can maybe find a different plugin or try to find a solution online for plugin implementation.
The theme alters the adsense code in order to display it. You can maybe try to use the ‘other ads’ method so the adsense does not get rewritten and maybe then the plugin can ‘work it’s magic’.
https://forum.tagdiv.com/using-other-ads/

I hope this helps.
Thank you!

Post count: 18

hi, how i can insert this custom other ads in the header so i can use the cookie block shortcode?

Post count: 22421

Hello,

I did a little digging on this issue and i have found an older method to implement the cookie policy:
Try to add your comments like this: http://screencast.com/t/z4xe1e16H9http://screencast.com/t/1kl8xB7AyHhttp://screencast.com/t/pa9MeBMJf8e

$buffy .= "\n <!–COOKIE_POLICY_BEGIN–> \n\n";

$buffy .= "\n <!–COOKIE_POLICY_END–> \n\n";

Hope this helps!
Thanks for the message!

Post count: 18

thanks for your help, i will try. With this metod i must insert the script adsense directly in the code of the page? I can not use the theme’s option, right?

Post count: 22421

Hello,
The method shown above is exemplified on another type of plugin that uses the shortcode like so
and
You can use the same method to add your own plugin shortcodes in the theme files then you can use your adsense code in the theme panel without other modifications. Simply place the adsense code in the preferred ad spot in the theme panel and it should work.
Thank you!

Post count: 18

i’m sorry but i don’t understand if i must use your code or the code of the privacy plugin.

In my case the script to block is:

<? if(isset($_COOKIE[‘rltcp_information_cookie’])):?>

my adsense code

<? endif; ?>

What i must to do? Thanks a lot for your help guy!

website is

  • This reply was modified 10 years by seosmart.
Post count: 18

the shortcode is:

[wp_cookie_privacy_lock]
[/wp_cookie_privacy_lock]

Post count: 18

i don’t understand if i must use the shortcode [wp_cookie_privacy_lock] and [/wp_cookie_privacy_lock] or this <? if(isset($_COOKIE[‘rltcp_information_cookie’])):?> and <? endif; ?>

here’s the instruction of plugin:

To block adsense banner in your theme paste this code

<? if(isset($_COOKIE[‘rltcp_information_cookie’])):?>
here paste your adsense code
<? endif; ?>

Shortcode

[wp_cookie_privacy_lock]

here the adsense code if user accept cookies

[/wp_cookie_privacy_lock]

Post count: 22421

Hello,

The method above shows how your plugin can be implemented in the theme code. As i replied above, we cannot offer plugin implementations support. I’m not sure if this method will work with your plugin. You can use an alternative one or maybe even find the one that uses the code used above. if you cannot do it you can maybe get some help or hire a freelancer to help out as we cannot offer any custom work. Sorry.

Thank you for your understanding.

Post count: 18

ok but if is it so, your theme don’t offer possibility to use correctly ads because the european cookie law wants we can block cookies. I have buyed this theme because i was sure i can do that with a simple shortcode.

Post count: 22421

Hi,
Unfortunately as i have stated above, there is no easy solution for this as the theme has no such option. I already provided a solution above and i will provide another one.
You can try by using a do_shortcode function so instead of the $buffy .= “\n \n\n”; and $buffy .= “\n \n\n”;

you can use your shortcodes like so:

$buffy .= do_shortcode('[wp_cookie_privacy_lock]');
$buffy .= do_shortcode('[wp_cookie_privacy_lock]');

and use it like the screenshots above.

Please keep in mind that the theme is not tested with this type of plugins and i cannot guarantee it will work. If you do not want to try the solutions i provided you can turn to an ad manager plugin to render your ad codes and use theme’s ad spots just for placements, in that case you can use plugin’s shortcodes to place your ads on theme’s specific ad spots.

Thank you!

Post count: 9544

Note also there are numerous cookie policy plugins which simply drop down or slide up a cookie policy notice at top or bottom margin of page to comply with European cookie policy law; this has been the case for several years now and not new. Most themes don’t include such function as it’s not a worldwide issue.

You might try looking in the wordpress.org plugin repository for any of the various plugins that do this for you and don’t require hacking the Adsense code.

Post count: 18

Thanks Bogdan.


@Chris
no, in the european cookie law compliance you MUST block cookies of thirdy party. You need not only a banner who shows simply the policy.

Post count: 18

hi all, @bogdan i tried the other way but nothing. Now i’m using another plugin for adsense but each plugin i use, the cookie block script don’twork only in your theme. See here: http://prntscr.com/9k6wna

Post count: 22421

Hello,
I understand your situation but unfortunately the theme has no options for the EU cookie law so you will have to use plugins to achieve this. Here is a list of plugins you can try out: https://wpism.com/comply-eu-cookie-policy-google-adsense/ but keep in mind that they are not tested and we cannot assure their functionality. If you require further plugin implementation assistance you will have to hire a freelancer to help you out as time does not allow us to offer any custom work at the moment.
Thank you!

Post count: 9544
Post count: 18

my cookie block plugin works only in the sidebar of your theme. It is very abnormal that i can not insert a shortcode in this theme or a simple “if”.

Post count: 23312

Hello seosmart,

Unfortunately, we cannot provide support for untested plugins, as you said Bogdan B above. Unfortunately, we have not tested these kinds of plugins and cannot say for sure if it will work with Newspaper theme. We have no idea of the plugin functionality so we cannot make a suggestion on how to use it best with our theme. You could try to contact the plugin’s author and ask him for advice, maybe he can point you to the right direction. Aslo, if you want to insert a shortcode in our theme, you have to use this function <?php echo do_shortcode('enter your short_code here');?> in corresponding file.
If it necessary custom work, please consider hiring a freelancer to do this for you as we cannot provide custom work at this time, sorry!

Thank you for your understanding!

Post count: 18

hello catalin,
my shortcode is: [wp_cookie_privacy_lock] my adsense code [/wp_cookie_privacy_lock]

Can you write me the correct function?


@Bogdan
i use the same plugin in all my website. Only in Newspaper, that is a complex theme, i have this problem. For this reason i don’t wont hire a freelance, because the problem is not the plugin but YOUR theme! I try different ways, different plugins but your theme don’t work well.

Thanks to all.

Post count: 18

Infact, in sidebar the shortcode works properly. It does’nt work in single post and header banner

Post count: 6600

Hi,

How do you add the adsense ad code and this shortcode into your sidebar? Please let us know and write us via email, at contact@tagdiv.com and also provide wp and ftp access so we can check your site’s configuration and these suggested implementations concerning this.

So, make sure you apply the latest solution Bogdan gave you and let us know so we can check and we will get back with an answer on this as soon as possible. Please also provide all necessary info so we can investigate this and also include a link to this conversation.

Lucian C.

Viewing 22 posts - 1 through 22 (of 22 total)
You must be logged in to reply to this topic.