
-
AuthorPosts
-
January 12, 2015 at 1:31 am #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.
ThanksJanuary 12, 2015 at 5:16 pm #378375Hi 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!
ElliottJanuary 13, 2015 at 2:34 am #378620This reply has been marked as private.January 13, 2015 at 9:20 pm #379121Hi!
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,
ElliottJanuary 14, 2015 at 2:47 am #379232Hi 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.
RgdsJanuary 14, 2015 at 7:20 pm #379682Hi!
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 10 years, 4 months ago by
Elliott.
January 15, 2015 at 5:02 am #379875Hi 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
January 16, 2015 at 6:04 pm #380938Hey!
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,
ElliottJanuary 16, 2015 at 10:22 pm #381109Hi,
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?
ThanksJanuary 18, 2015 at 12:24 pm #381448Hi!
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,
IsmaelJanuary 18, 2015 at 10:18 pm #381535Hi 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 -
This reply was modified 10 years, 4 months ago by
-
AuthorPosts
- The topic ‘Openning external links in new tab or window’ is closed to new replies.