Add search function to topbar

Hi guys,
I’d like to put the search box on my topbar, but it can only be added automatically to the Nav bar.
I know where to put the code (Topbar content) I just don’t know what to type in there.
Any ideas?
Thanks

I have the same question… and additionally can I create a dedicated page to “search” and if so is there a shortcode or something to use to do this?
Thanks!
Rob

Hi @ths-kbad and Rob,

There’s 2 function that handles the search function on the navbar. It is x_navbar_search_navigation_item() and x_navbar_searchform_overlay() from this file: wp-content\themes\x\framework\legacy\cranium\headers\functions\navbar.php. The first function handles how the item is added on the menu and the other is how the popup works. Feel free to copy those functions on your child theme functions.php file or in this case topbar template. Note that those 2 functions check if NAVBAR SEARCH option on the Customizer/Theme Options is enable on the code. You might want to consider that when implementing the code.

The topbar template where you might need to implement that is here: wp-content\themes\x\framework\legacy\cranium\headers\views\global\ _topbar.php. You may copy it on your child theme here: wp-content\themes\x-child\framework\legacy\cranium\headers\views\global _topbar.php

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.