Adding Search Bar to Menu

Home Forums Iconic One Pro Support Adding Search Bar to Menu

This topic contains 1 reply, has 2 voices, and was last updated by  Themonic-Support 3 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1642

    tomnarvaez
    Participant

    Is it possible to add a search bar to the menu aligned to the right side?

    I have tried to use this code:

    //wordpress search in menu bar
    add_filter('wp_nav_menu_items','add_search_box', 10, 2);
    function add_search_box($items, $args) {
     
            ob_start();
            get_search_form();
            $searchform = ob_get_contents();
            ob_end_clean();
     
            $items .= '<li>' . $searchform . '</li>';
     
        return $items;
    }

    But the result is this:
    Search Bar Mess Up

    Any possible solutions?

    Thanks in advance

    #1647

    Themonic-Support
    Keymaster

    Pro Members only. Login to see the content.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.