Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #378078

    I recently updated Enfold theme from 2.9.1 to 3.0.4 on WP 4.1 and since then I cannot get external links to open in a new tab or window. I have checked box to open links in new window but that doesn’t do it. Interesting enough, external links open in new tab when I am logged into WP admin but not when logged off.
    I found a prescribed solution on the forum but it is dated back to 2011 and I cannot seem to find the file referenced (custom.js) in my enfold files. Hoping you can help keep visitors on my site.
    Thanks

    #378375

    Hi Awelana!

    When you say “have checked box” your talking about the WordPress menus in Dashboard > Appearance > Menus correct? Are you sure you have the correct menu being displayed?

    Try deactivating all plugins and send us a WordPress login so we can take a closer look.

    Cheers!
    Elliott

    #378620
    This reply has been marked as private.
    #379121

    Hi!

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

    add_action( 'wp_footer', 'enfold_customization_footer_script' );
    function enfold_customization_footer_script() {
    ?>
    <script type = "text/javascript">
    jQuery(document).ready(function(){
    jQuery(".social_bookmarks a").attr("target", "_blank");
    });
    </script>
    <?php
    }

    Regards,
    Elliott

    #379232

    Hi Elliot,
    Added code but no change. Facebook widget in footer opens in new tab but social media icons on top (header) still open in existing tab; same for all other external links.
    Rgds

    #379682

    Hi!

    I don’t see it in your source code. Did you remove it? Add it back in please. It should be at the bottom of your functions.php file.

    Also be sure to deactivate all plugins while testing.

    Regards,
    Elliott

    • This reply was modified 9 years, 2 months ago by Elliott.
    #379875

    Hi Elliott,
    I removed it because the entire site wasnt loading anymore and was throwing an error as a result.
    Have added the code back, disabled all plugins, tested and all external links open in new tabs as expected. I reactivated a plugin at a time. Worked fine with all plugins except W3 Total Cache and WP Google Analytics. I would like these 2 plugins active as well.

    Thanks

    #380938

    Hey!

    I’m guessing it’s the caching plugin. Activate the plugins and then clear it’s cache and then clear your browser cache to see the changes.

    Best regards,
    Elliott

    #381109

    Hi,
    Done that: activated plugin, cleared cache of plugin and browsers but still not working with W3 Total Cache and WP Google Analytics. Not sure what the compatibility issues are. Are there alternative plugins I could use?
    Thanks

    #381448

    Hi!

    Try to replace the code with this:

    /**
     * Social Bookmarsk Attribute
     */
    
    //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
    }

    Or edit includes > helper-social-media.php, remove everything then replace it with this code: http://pastebin.com/teD0tKsj

    Regards,
    Ismael

    #381535

    Hi Ismael,
    I went with the first option: replacing code in functions.php with new code you provided. Worked fine with all plugins except Google Analytics. I can live with that for now. I have entered google tracking code in theme settings to get analytics – hope it is as effective.
    Thanks to you and Elliot for helping out.
    A

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Openning external links in new tab or window’ is closed to new replies.