Tagged: Cookie Consent
-
AuthorPosts
-
May 3, 2018 at 12:42 am #950386
Hi.
Firstly I love the new additions in Enfold 4.3. Keep up the good work 🙂
In particular, I like the Cookie Consent option as it will mean I have one less plugin to install.The issue I have is that the “learn more” link opens up a new tab in the browser and I want it to stay in the same tab to show my cookie policy page. Is there an easy way to change this in the settings and could it be included as an option in a future update.
I appreciate some people will prefer it to open a new tab but I only really do that for external links on my site.Hope you can help.
Thanks
May 4, 2018 at 6:34 am #951344Hey fusionxs,
Thank you for using Enfold.
You can use this script to change the target attribute of the cookie consent button.
add_action('wp_footer', 'ava_custom_script'); function ava_custom_script() { ?> <script> (function($) { $(document).ready(function() { $('#avia_cookie_consent').attr('target', '_blank'); }); })(jQuery); </script> <?php }
Best regards,
IsmaelMay 4, 2018 at 1:24 pm #951635Sorry Ismael, where do I add that script and will I need to re-add it every time I upgrade Enfold?
May 5, 2018 at 8:06 am #952051Hi,
Please try it in your child theme functions.php file, if you are running a child theme then you won’t have to change anything on updates.
Best regards,
RikardMay 8, 2018 at 1:06 am #952991Hi
Can you verify that code is correct please as I have tried adding it to the bottom of the functions.php file but when I click on “learn more” in the Enfold cookie bar, it still opens a new page to my cookie policy page and I want it to stay in the same browser tab?
Thanks
May 8, 2018 at 10:43 pm #953595Hi,
That is what the code Ismael provided does.
DO you want to change that?Best regards,
BasilisMay 8, 2018 at 11:02 pm #953609The code doesn’t change the default for me.
Adding the code still means that when I click on “learn more” it opens in a new tab and I don’t want it to.
I have also tried changing _blank to _self in the code but that didn’t seem to work either.May 10, 2018 at 5:45 am #954305Hi fusionxs,
Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?
Best regards,
VictoriaMay 10, 2018 at 4:18 pm #954639Hi Victoria
I had a security issue last year when I gave somebody access to one of my websites so I made the decision back then never to give somebody outside of my business access to my websites again.
I am sure you are trustworthy but it’s just a decision I made.
I will leave the default option as it is for now but I think it would be a good idea to provide the option for the user to change the default. With all the cookie notice plugins I have used, they include the option to decide whether to use _blank or _self for opening links to cookie policy pages.
Thanks
May 11, 2018 at 12:09 pm #955213Hi fusionxs,
That’s ok, can you give us the link to your website?
Best regards,
VictoriaMay 11, 2018 at 2:14 pm #955297This reply has been marked as private.May 12, 2018 at 8:24 am #955600Hi fusionxs,
Please try the code below.
Here is the code you can put in your funtions.php
add_action('wp_footer', 'ava_custom_script'); function ava_custom_script() { ?> <script> (function($) { $(document).ready(function() { $('.avia_cookie_infolink').attr('target', '_self'); }); })(jQuery); </script> <?php }
If you need further assistance please let us know.
Best regards,
VictoriaMay 12, 2018 at 10:49 pm #955870Excellent!
That works for me now.Thanks for your help.
🙂
May 13, 2018 at 7:37 am #955965 -
AuthorPosts
- You must be logged in to reply to this topic.