Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #345882

    Hi, I recently asked how to amend the socket link in the new theme update.

    You replied and all was fine but have just realised that the link now opens in the same Tab.

    I want in to open in a new browser tab so this is what I inserted in Enfold – Footer – Copyright (see private content) including target=”_blank” but it is not working.

    What do I need to do?

    Thanks

    #345885

    Hey GOWD!

    Please add following code to Functions.php file in Appearance > Editor

    function add_custom_socket_target(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery('#socket a').attr('target','_blank');
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_socket_target');

    Regards,
    Yigit

    #346024

    Hi Yigit,

    I added your code to the Functions.php file of my child theme and when I refreshed the page I got the White Screen of Death.

    I FTP into the host, downloaded the file, removed the code, re-uploaded, site now working again.

    Is there an error?

    #346038

    Hi!

    Code seems fine. If you do not mind creating a temporary admin login we can add the code for you

    Best regards,
    Yigit

    #347232

    Hi Yigit, the target=”_blank” I initially added to Enfold – Footer – Copyright has suddenly started working so no need for the code now.
    Thank you for your help.
    You may close this thread.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Socket Link to Open in a new Tab’ is closed to new replies.