-
AuthorPosts
-
May 28, 2021 at 1:56 pm #1302834
Is it possible to replace the standard AJAX search with a search box that takes over the secondary sub menu?
Example I’m trying to achieve below using the enfold theme.
Currently I have the AJAX search in place below. I want to take it one step further that when the search button is pressed it will over lay across the secondary menu. For a mobile user also this will look better then the standard ajax solution.
/* Header Meta Search Icon */
if(!function_exists(‘avia_append_header_meta_search_icon’))
{
//first append search item to main menu
add_filter( ‘wp_nav_menu_items’, ‘avia_append_header_meta_search_icon’, 9997, 2 );
add_filter( ‘avf_fallback_menu_items’, ‘avia_append_header_meta_search_icon’, 9997, 2 );function avia_append_header_meta_search_icon( $items, $args )
{
if (is_object($args) && $args->theme_location == ‘avia2’)
{
global $avia_config;
ob_start();
get_search_form();
$form = htmlspecialchars(ob_get_clean()) ;$items .= ‘<li id=”menu-item-search” class=”noMobile menu-item menu-item-search-dropdown menu-item-avia-special”>
<span class=”avia_hidden_link_text”>’.__(‘Search’,’avia_framework’).'</span>
‘;
}
return $items;
}
}May 31, 2021 at 2:46 pm #1303196Hey,
Thanks for contacting us!
I adjusted your code a bit and then added following code to Quick CSS field in Enfold theme options > General Styling tab
#top #header_meta #searchform { float: right; margin-left: 10px; } #top #header_meta #s { padding: 5px 47px 5px 5px; } #top #header_meta #searchsubmit { line-height: 30px; }Please review your website :)
Best regards,
Yigit -
AuthorPosts
- You must be logged in to reply to this topic.
