Forums
Home / Theme: raindrops / Open menu link in new tab
(@galapogosian)
10 years, 2 months ago
Hi-
I’ve created a custom menu so that I may link to other pages from the sidebar. In the menu structure tab, each item has a title and link field.
Photo:
What I need to do is make each link open in a new tab.
(@nobita)
Hi galapogosian
Please open functions.php
Add first line (<?php before )
<?php
<?php add_filter( 'nav_menu_link_attributes','nobita_add_attribute', 10, 3 ); function nobita_add_attribute( $content,$item, $args ){ $content['target']= '_brank'; return $content; } ?>
Thank you.
Thank you. Worked like a charm!