• Resolved thatfray

    (@thatfray)


    Hi

    I managed to add a search bar at the secondary menu using the code below:

    //Search
    add_filter( 'wp_nav_menu_items','add_search_box', 10, 2 );
    function add_search_box( $items, $args ) {
        $items .= '<li>' . get_search_form( false ) . '</li>';
        return $items;
    }

    But now theres an extra one on the top bar. Please tell me how to remove that extra one or make it show only on the secondary nav.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Remove double search bar’ is closed to new replies.