Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #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

    #951344

    Hey 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,
    Ismael

    #951635

    Sorry Ismael, where do I add that script and will I need to re-add it every time I upgrade Enfold?

    #952051

    Hi,

    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,
    Rikard

    #952991

    Hi

    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

    #953595

    Hi,

    That is what the code Ismael provided does.
    DO you want to change that?

    Best regards,
    Basilis

    #953609

    The 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.

    #954305

    Hi 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,
    Victoria

    #954639

    Hi 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

    #955213

    Hi fusionxs,

    That’s ok, can you give us the link to your website?

    Best regards,
    Victoria

    #955297
    This reply has been marked as private.
    #955600

    Hi 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,
    Victoria

    #955870

    Excellent!
    That works for me now.

    Thanks for your help.

    🙂

    #955965

    Hi fusionxs,

    Great, glad you got it working. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

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