Viewing 3 replies - 16 through 18 (of 18 total)
  • Thread Starter thatfray

    (@thatfray)

    Don’t be mad.

    I decided to scrap the whole thing and have built a custom Menu that drops down on the topbar. It would be awesome if the search bar can fit in there because i found that since i have an immovable popup flag on the top right, i don’t have any more space when its mobile.

    This is the code i’m currently using, i removed the parts i mentioned above.

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

    The weirdest part is when i use secondary, it goes to the topbar, when i use primary, it goes to the bottom(sec menu).

    So…any idea how i can embed that search inside, bottom of the accordian?

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

    It was just missing a closing )

    Kadence Themes

    Thread Starter thatfray

    (@thatfray)

    ok thank you

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘Links on topbar squished together’ is closed to new replies.