-
AuthorPosts
-
February 6, 2018 at 5:00 am #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,
NikkoFebruary 6, 2018 at 6:47 am #908369Thanks 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.
February 6, 2018 at 12:56 pm #908540Hello Nikko,
The functions.php file of my child theme is totally empty, are you working on it?
February 6, 2018 at 2:31 pm #908599Hi,
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.
February 6, 2018 at 4:22 pm #908661No problem,
Can the search icon be removed from the top and bottom?
February 6, 2018 at 4:48 pm #908676Hi,
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,
NikkoFebruary 6, 2018 at 6:56 pm #908722No 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.
February 7, 2018 at 12:43 pm #909080Hi 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,
NikkoFebruary 7, 2018 at 6:58 pm #909344Yes Nikko, it’s all good now, thank you very much
If you like it, you can close the thread
February 8, 2018 at 2:26 am #909510Hi,
Glad we could help! :) Thanks for using Enfold and have a nice day :)
Best regards,
Nikko -
AuthorPosts
- The topic ‘Show search in all main menus’ is closed to new replies.