'wordpress: I want to add cookies popup on my wordpress site
I have added cookies popup on my wordpress site, and it appears on all the pages, I want to make sure, cookies popup won't appear on privacy-policy page. I'm using the plugin cookie notice to add cookies on my site. please suggest how i can make sure cookies popup won't appear on privacy policy page
Solution 1:[1]
Add this code in functions.php file and replace page id with privacy policy page id.
function disable_cookie_notify( $output, $options ) {
if(is_page(2)){
$output = '';
}
return $output;
}
add_filter( 'cn_cookie_notice_output', 'disable_cookie_notify', 10, 2 );
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Vel |
