Customizing Only a Specific Menu using the “wp_nav_menu_items” Hook?

Posted by Prem Tiwari | Updated on

To only add the custom search box to the main menu you could pass the second parameter provided by the wp_nav_menu_items filter and check if the theme_location is the primary location:

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@] Your question and answer will appear on and help other developers.

Related Questions & Answers