Tagged: menu link, new window, nofollow
-
AuthorPosts
-
September 27, 2014 at 10:30 pm #326032
I have a link on the main menu that doesn’t open in a new window or add a nofollow link even if I add those from the screen options. Is there a way I can adjust this so it opens in a new window and tells spiders not to follow?
September 30, 2014 at 4:13 am #326956Hey broshannon!
Thank you for using Enfold.
I’m sorry but you can’t apply these attributes on mega menu columns. However, you can apply it using this at the very bottom of functions.php:
function add_custom_script(){ ?> <script> jQuery(window).load(function(){ jQuery('#top #header .mega_menu_title a').attr({target: '_blank', rel: 'nofollow'}); }); </script> <?php } add_action('wp_head', 'add_custom_script', 10);Regards,
IsmaelSeptember 1, 2017 at 10:41 am #846781Solved that problem. Thanks
September 1, 2017 at 10:44 am #846784Oops spoke too soon. Now all links open in a new window.
:-)
Thanks for being there for support.
September 2, 2017 at 6:24 am #847073Hi 702arts,
Could you post a link to the site in question so that we can take a closer look please?
Best regards,
RikardMarch 14, 2019 at 12:04 am #1078448Hello,
I have the same problem. I used the code above. I have a mega menu with 2 entries and both entries are opening in a new tab, but only one of them should behave that way.
Thank you for support!
March 14, 2019 at 12:39 am #1078456Hey Liebreiz,
Please provide a link to the site/page in question. And which one is supposed to be opening in a new tab?
Best regards,
Jordan ShannonMarch 14, 2019 at 2:24 pm #1078704Hi,
I checked it on my install – and cannot reproduce the problem.
Could you try to disable all plugins and check ? Maybe a plugin conflict.
Please create a WP admin account for us so we can check your backend.
Steps:
Dashbord -> Appearance -> Menus
In Screen Options selected all checkboxes “Show advanced menu properties”
In Menu element selectbox ink Target “New window” and in link Relationship (XFN) = “nofollow”
Works for mega menu elements and normal menu elements.
Best regards,
GünterMarch 14, 2019 at 11:57 pm #1078948Hello,
Thank you for your response. It only works if I switch off the mega menu option. This is ok for the moment. It looks better to me.
Best Regards.March 15, 2019 at 2:11 pm #1079131 -
AuthorPosts
- The topic ‘Menu Link won't open in new window with Mega Menu’ is closed to new replies.
