WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Open navigation item in a specific target

[Resolved] Open navigation item in a specific target

  • Hi!

    I’m wondering if there’s a way to open a navigation item in a SPECIFIC target in WP. Using the Menu Editor, one can only open an item in a blank window ticking the “Open link in a new window/tab” checkbox.

    Any ideas?

    Thanks in advance

Viewing 1 replies (of 1 total)
  • I found the solution:

    function my_setup_nav_menu_item($menu_item) {
       $menu_item->target = "target_name";
       return $menu_item;
    }
    add_filter('wp_setup_nav_menu_item', 'my_setup_nav_menu_item', 0);
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] Open navigation item in a specific target’ is closed to new replies.
Skip to toolbar