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?
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:
Hi Arlind, I'm going to check it. Thanks!
It wordked perfectly. Thanks!
Great to hear that!