Hello,
Please take a look at response #163800
I’ve managed to alter the function-enfold.php file to but the search icon in the secundary menu,
but how do I put the altered code in my child theme so when I overwrite the theme with an update it keeps the button that way?
Greets Jeen
Hey Groeier!!
Send us a link to the topic your referring to please.
Regards,
Elliott
Hello,
Here’s the link:
https://kriesi.at/support/topic/move-search-icon-to-secondary-menu/
Greets Jeen
Hi!
Add this to the bottom of your child theme functions.php file.
//first append search item to main menu
add_filter( 'wp_nav_menu_items', 'avia_append_search_nav', 10, 2 );
add_filter( 'avf_fallback_menu_items', 'avia_append_search_nav', 10, 2 );
function avia_append_search_nav ( $items, $args )
{
if(avia_get_option('header_searchicon','header_searchicon') != "header_searchicon") return $items;
if(avia_get_option('header_position', 'header_top') != "header_top") return $items;
if ((is_object($args) && $args->theme_location == 'avia2') || (is_string($args) && $args = "fallback_menu"))
{
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">
<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>
</li>';
}
return $items;
}
Regards,
Elliott
Thanks Elliott!
Works perfect.
Greets Jeen