Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
April 18, 2018 at 11:05 am #943535
Hi,
Is it possible to add Ajax Search (normally in main menu) to Header meta position? Or is it possible to add this to a submenu?
I know how to add the regular search function, but i would like to add the ajax search function with only search icon (and ‘search popup’).April 20, 2018 at 4:51 am #944412Hey Roel,
Thank you for using Enfold.
Yes, this is possible. Just duplicate the default search icon filter and modify it a bit. Add it in the functions.php file.
/* 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"> <a href="?s=" data-avia-search-tooltip="'.$form.'" '.av_icon_string('search').'><span class="avia_hidden_link_text">'.__('Search','avia_framework').'</span></a> </li>'; } return $items; } }
Best regards,
IsmaelSeptember 28, 2019 at 3:39 pm #1143008Hi,
I used that code and the search icon appeared on right side, i would like change the position to left side, after other icons, look the image attached (links).
Dropbox: https://www.dropbox.com/s/0e2r99cpofgh8wf/search.png?dl=0 or
Wetransfer: https://we.tl/t-KBJr388hAQSeptember 30, 2019 at 6:21 am #1143227 -
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.