Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #491149

    How can I add the Ajax search with the magnifying glass we have in the main menu to the vertical menu? I’d like for it to work the same way it does in the header, just in the sidebar.

    #491984

    Hey Lissasan!

    Thank you for using Enfold.

    Please add this in the functions.php file:

    add_filter( 'ava_main_header', 'avia_append_search_nav_mod', 10);
    
    function avia_append_search_nav_mod()
    {
        ob_start();
        get_search_form();
        $form =  htmlspecialchars(ob_get_clean()) ;
    	
        $items = '<div id="menu-item-search-mod" class="menu-item-search-mod menu-item menu-item-search-dropdown">
            <a href="?s=" rel="nofollow" data-avia-search-tooltip="'.$form.'" '.av_icon_string('search').'><span class="avia_hidden_link_text">'.__('Search','avia_framework').'</span></a>
               </div>';
    
        echo $items;
    }

    Use this in the Quick CSS field to adjust the position of the search icon.

    #menu-item-search-mod {
        position: absolute;
        right: 50px;
        z-index: 6000;
    }

    Cheers!
    Ismael

    #492523

    Thank you Ismael! This gave me what I needed. You guys rock!

    #492768

    Hi,

    Glad we could help :-)

    Regards,
    Rikard

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Add Ajax Search to Vertical Menu’ is closed to new replies.