Quick Button Hidden with… 1 exception/page
-
Hi and thanks for your plugin!
I would like the Quick Button (bottom left) to be visible only on 1 page and remain hidden on all the others: how can I do it?
-
Greetings from CookieYes!
To make the revisit icon visible on just one page, please try the following custom script:
<script>
if (window.location.pathname !== '/your-page-slug') {
const cky_style = document.createElement('style');
cky_style.innerHTML =.cky-btn-revisit-wrapper{display: none !important;};
document.head.appendChild(cky_style);
}
</script>Replace
your-page-slugwith the specific slug of the page where you’d like the revisit icon to be visible. This will hide the button on all other pages.First of all, thank you for your reply!
Should I leave the selector in “Revisit Consent Button” (Content&Colors/Cookie Banner) disabled or enabled?
And then how do I put this script: is an html box in the page enough or do I need a plugin like “snippet code”?
Thanks againPlease ensure the “Revisit Consent Button” is enabled.
You can add the script to your active theme’s
header.phpfile or use a third-party plugin that allows you to insert scripts into the<head>section.In the code provided previously, please add a backtick
`before.cky-btn-revisit-wrapperand after!important;}to ensure it functions correctly. It seems WordPress may have removed the backtick from my previous response.Thank you Sir.
I’ve tried this but it doesn’t work (https://ibb.co/m95S7jx)
Am I doing something wrong?Please share the site URL where you have implemented this.
Yes: https://7i.se/iD
This is my test environment website.
I want it to appear only on the privacy page and not on the rest of the site: thanks!Please find the modified code here:
<script>
if (window.location.pathname !== '/sito2/privacy/') {
const cky_style = document.createElement('style');
cky_style.innerHTML =.cky-btn-revisit-wrapper{display: none !important;};
document.head.appendChild(cky_style);
}
</script>Hi Sir. I try here (https://ibb.co/rZZPmfZ) but it doesn’t work… possible that I wrong something?
Please add the code to the Head itself. And also, don’t miss the backtick.
This thread has been inactive for a bit, so we are going to mark it as resolved now. Please feel free to open a new thread or follow-up if you have any further questions or still need help.
Hi Sir. I’ve tried in any way (https://ibb.co/cwF51wd) but it doesn’t work :'(
https://7i.se/4a
Is it all fine, right? How can I fix only this thing? ThanksYou have not added the backtick
`before.cky-btn-revisit-wrapperand after!important;}Yes: sorry, now it works! Thank you so much Sir! I really appreciate your support!
The topic ‘Quick Button Hidden with… 1 exception/page’ is closed to new replies.