Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #805235

    See http://theqmart.com/

    Notice the social sharing links in the header are not opening in a new tab, as should be standard. How can I make the site do this?

    But also, the same thing is happening to social icons I have hard coded into the footer widget. They are set to “target=_blank” and they are still opening in the same browser tab.

    Is this a bug in enfold? Or am I missing a setting in the theme somewhere?

    Thanks,
    Rob

    #806653

    Hey robphat,
    For the social bookmarks in your header add this to the bottom of your functions.php file.

    //add_filter('wp_footer', 'avf_social_attr', 10);
    function avf_social_attr() { ?>
    <script>
    (function($){
        $(window).load(function(){
    		$(".social_bookmarks a").attr("target", "_blank");
    	});
    	
    })(jQuery);
    </script>
    <?php
    }

    Your target=”_blank” in the footer didn’t work, but you could try this plugin: https://wordpress.org/plugins/open-external-links-in-a-new-window/

    Best regards,
    Mike

    #806999

    The first code to open social links in new tab didn’t work, but the plugin https://wordpress.org/plugins/open-external-links-in-a-new-window/ did work. It took care of both.

    But out of curiosity, whey doesn’t target=_blank work on enfold?

    #807257

    Hi,

    Glad you found a solution and thanks for sharing, target blank work but there might have been a mistake in the code.

    Best regards,
    Rikard

    #807598

    Ok thanks. I saw some other Posts online where some WordPress themes target=_ blank was not working properly either. And they suggested the plug-in you suggested. So I guess there is something in the theme that prevents yarget=_blank from working. In either case the plugin helped. Thanks

    #807698

    Hi,
    Glad we were able to help, we will close this now. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘links that should be opening in a new browser tab are not’ is closed to new replies.