Tagged: menu link, new window, nofollow
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?
Hey 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,
Ismael
Solved that problem. Thanks
Oops spoke too soon. Now all links open in a new window.
:-)
Thanks for being there for support.
Hi 702arts,
Could you post a link to the site in question so that we can take a closer look please?
Best regards,
Rikard
Hello,
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!
Hey 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 Shannon
Hi,
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ünter
Hello,
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.