Tagged: ajax search
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.
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
Thank you Ismael! This gave me what I needed. You guys rock!