Tagged: ,

Viewing 10 posts - 31 through 40 (of 40 total)
  • Author
    Posts
  • #908337

    Hi,

    Thanks for providing the ftp access, it’s working now, I have added this css code in your child theme:

    add_filter( 'wp_nav_menu_items', 'avia_append_search_nav', 9997, 2 );
    add_filter( 'avf_fallback_menu_items', 'avia_append_search_nav', 9997, 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) || (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 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;
    }

    Let us know if you need further assistance :)

    Best regards,
    Nikko

    #908369

    Thanks Nikko!!

    But now it is displayed at the top and at the bottom of the page, can it be removed?

    • This reply was modified 6 years, 9 months ago by Luis.
    #908540

    Hello Nikko,

    The functions.php file of my child theme is totally empty, are you working on it?

    #908599

    Hi,

    I apologize, my connection was suddenly cut off while I was working on it. Please paste this on functions.php:
    https://pastebin.com/m2F0EqYp
    This is what your whole functions.php contains and should work properly and I apologize again for the incovenience. :(

    Best regards,
    Nikko

    • This reply was modified 6 years, 9 months ago by Nikko.
    #908661

    No problem,

    Can the search icon be removed from the top and bottom?

    #908676

    Hi,

    Yes, this part of the code I gave should work:

    add_filter( 'wp_nav_menu_items', 'avia_append_search_nav', 9997, 2 );
    add_filter( 'avf_fallback_menu_items', 'avia_append_search_nav', 9997, 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) && !strstr($args->theme_location, 'avia2') && !strstr($args->theme_location, 'avia3')) || (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 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,
    Nikko

    #908722

    No friend, I already put that code and the search icon still appears on the top and bottom

    Added after:

    It is done!!! I had not deleted the browser cache and it kept showing up. Thank you very much Nikko, very kind and patient. Sorry for all the inconvenience

    • This reply was modified 6 years, 9 months ago by Luis.
    #909080

    Hi Luis,

    You’re welcome and I apologize again. :( I have tested the admin you provided, the user in private content, and viewing the site without logging in and it works on all 3, search is only showing up on the main menu (top and footer menu doesn’t show the search anymore). If it’s still showing try to flush out cache from the caching plugin.

    Best regards,
    Nikko

    #909344

    Yes Nikko, it’s all good now, thank you very much

    If you like it, you can close the thread

    #909510

    Hi,

    Glad we could help! :) Thanks for using Enfold and have a nice day :)

    Best regards,
    Nikko

Viewing 10 posts - 31 through 40 (of 40 total)
  • The topic ‘Show search in all main menus’ is closed to new replies.