Important:
This support area is for Kalium 3 users only.
Support for Kalium 4 has moved to our new platform at support.laborator.co.
If you’re using Kalium 4, please create a new account there using your email and license key. A password will be sent to you automatically.
Hello,
I'm trying to add a searchbox in header main navigation menu. I found this code and it worked it
The problem is that it adds the searchbox in all menus of the site. So I tried to add a filter to show it just in the 'main' menu (tha's the name of the menu):As it didn't work, I change 'main' for 'primary', but I don't know why it still does not work. Could you tell me how to filter the function to the main menu?
Thanks,
Best,
Mire
Hi Mire,
Instead of main and primary set main-menu and that is the correct location of our Main Menu in the header.
Your second menu filter function will work with this and it should look like:
add_filter( 'wp_nav_menu_items','add_search_box', 10, 2 ); function add_search_box( $items, $args ) { if ( 'main-menu' == $args->theme_location ) $items .= '<li>' . get_search_form( false ) . '</li>'; return $items; }Hi Arlind, I'm going to check it. Thanks!
It wordked perfectly. Thanks!
Great to hear that!