Tagged: header, mobile, search box
-
AuthorPosts
-
February 11, 2016 at 2:50 am #581422
Hi guys!
On mobile the search icon dissapears in the header. I found some solutions here on the forum, but they all don’t seem to work with me :-S
Is there a way to add a search box at the top, like all the apps and big sites have nowadays?grt Boris
February 14, 2016 at 7:53 am #582862Hi Boris!
Thank you for using Enfold.
You can add the search box inside the mobile menu. Add this in the functions.php file:
add_filter( 'wp_nav_menu_items', 'avia_append_search_nav', 10, 2 ); function avia_append_search_nav ( $items, $args ) { if ($args->theme_location == 'avia') { $search_form = get_search_form(false); $items = '<li id="menu-item-searchbox">'.$search_form.'</li>' . $items; } return $items; }And this code in the Quick CSS field:
#menu-item-searchbox form div { display: block !important; opacity: 1 !important; width: auto !important; } #menu-item-searchbox form div #s { width: 300px !important; max-width: 300px; } #menu-item-searchbox { top: 25px; } #top #searchsubmit, .ajax_load { right: 0px; }Regards,
IsmaelFebruary 20, 2016 at 2:13 am #586368Hey Ismael,
Is there a certain place in the ‘functions.php file’ where I should put it or can I put it anywhere?
grt Boris
February 22, 2016 at 8:10 am #586926Hi Boris,
Please try it at the end to see if you have any luck with it.
Best regards,
RikardFebruary 23, 2016 at 1:38 am #587513Hey Rikard,
Aha ok. Is there anything after the code I should put in that file, as a final ender or so!? Or just copy paste it at the end?
grt Boris
February 24, 2016 at 6:39 am #588159Hi,
No it should work simply copy/pasting it, not sure what your functions.php file looks like but the only thing to look out for it to not paste it after the end php code, it there is one:
?>Thanks,
RikardFebruary 29, 2016 at 7:13 pm #591035Hey Rikard,
I just checked, there is no end php code!? Should there be one?
grtz Boris
March 1, 2016 at 7:26 am #591373Hi,
If it works without one all is good, if it doesn’t work then please try to add it to see if that works better.
Regards,
RikardMarch 1, 2016 at 12:17 pm #591479Ah ok, thx. Well it is working ;-)
March 1, 2016 at 12:46 pm #591493Hey!
Glad you got it short out.
let us know if we can do anything else for you.Cheers!
Basilis -
AuthorPosts
- The topic ‘search box in header on mobile’ is closed to new replies.
