Search Bar in Menu

Home Forums Iconic One Pro Support Search Bar in Menu

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

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

    Themonic-Support
    Keymaster

    I am adding search bar in wordpress menu bar
    using this code in functions.php

    //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;
    }

    In iconic theme version, its showing fine.

    http://i41.tinypic.com/n6tcld.png

    In pro version, see both screenshots

    http://i40.tinypic.com/11scnr4.jpg

    #668

    Themonic-Support
    Keymaster

    In the Pro version, the search form accessible via Appearance -> widgets is pre- styled which is the reason it is behaving like that. You can place it in the sidebar or footer widgets to see how it appears by default.

    Search form in the menu bar is entirely possible by removing searchform style css completely but it is not recommended because we are not sure how it will behave in the responsive environment. If you have implemented it already let me know the URL so that I can have a look.

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

You must be logged in to reply to this topic.