Display Menu Name using wp_nav_menu

Posted by Prem Tiwari | Updated on

Display Menu Name using wp_nav_menu. If you know the menu’s slug, then things are easier, otherwise you can use this function to get the menu at a specified location.


Or, rather than echo the html, you could pass it as part of the the argument for the items attribute in wp_nav_menu.

For example, to display the menu at location primary:

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

Related Questions & Answers