Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #848671

    Hey :)

    I have created two header menu. One is set to default main menu while the second is set to show on a certain page. The second menu does not show the small search icon on mobile devices.

    How to fix this?

    #848993

    Hey enfoldgirl,

    Could you please give us a link to your website, we need more context to be able to help you.

    Best regards,
    Victoria

    #849522

    Hey Victoria,

    Yes, here are the links.

    #850270

    Hi,

    How did you assign a different menu? Are you using a plugin? Please upgrade the theme from 4.0.2 to 4.1.2.

    Best regards,
    Ismael

    #850942

    Hey Ismael, :)

    Yes i´m using a plugin to assign different menus, it´s called “Zen Menu Logic”.
    If i need to change menu for a specific page, i have to do it within that page, but when i do the search icon disappear :(

    Updated to 4.1.2

    #851008

    Hi enfoldgirl,

    Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?

    Best regards,
    Victoria

    #851432

    Hey,

    Of course, i send it private :)

    Thanks!

    #851647

    Hi enfoldgirl,

    It says that search is appended only to the main menu
    https://cl.ly/2N2l3o011E3z
    All other menus are not main menus and so the search is not appended.
    You will need to make edits in /themes/enfold/includes/helper-main-menu.php to have search on all menus.

    Best regards,
    Victoria

    #852437

    Hey Victoria, i know that the search is appended to main menu :)

    What kind of edits do i need to make in PHP, can you guide me in the right direction?
    And why not show the search in every menu?

    #852790

    Hi,

    If you want to append the search icon on every menu groups, please add this filter in the functions.php file.

    add_action( 'after_setup_theme', 'after_setup_theme_append_search', 100 );
    function after_setup_theme_append_search() {
    	remove_filter( 'wp_nav_menu_items', 'avia_append_search_nav', 9997, 2 );
    	remove_filter( 'avf_fallback_menu_items', 'avia_append_search_nav', 9997, 2 );
    	add_filter( 'wp_nav_menu_items', 'avia_append_search_nav_mod', 9997, 2 );
    	add_filter( 'avf_fallback_menu_items', 'avia_append_search_nav_mod', 9997, 2 );
    }
    
    function avia_append_search_nav_mod( $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;
    
    	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,
    Ismael

    #853329

    Hey Ismael,

    After updating and making some changes everything is working perfect!
    Thanks for this awesome Theme and of course all the the help :D

    #853676

    Hi,

    Great, glad you got it working and thanks for the feedback. Please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Only one of my menus are showing the "Search icon".’ is closed to new replies.