Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #369212

    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

    #369553

    Hey Groeier!!

    Send us a link to the topic your referring to please.

    Regards,
    Elliott

    #369776
    #370061

    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

    #370576

    Thanks Elliott!
    Works perfect.

    Greets Jeen

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Move search box to secundary menu’ is closed to new replies.