WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to figure out how to display a menu that has been created, but without having to assign the menu to a theme location.

From what I can tell, you have to assign a menu to a theme menu location and then wp_nav_menu calls a menu from whatever location you want.

I don't want to have to assign a menu to a theme location. Instead, I want to be able to create a menu and then query it within my theme... regardless of theme location.

I've created a plugin for myself that uses wp_get_nav_menus to list all of the menus I've created... I can then assign any menu to a page/post. Now, I'm stuck trying to figure out how to retrieve that specific menu... again, not menu theme location.


share|improve this question
up vote 2 down vote accepted

wp_nav_menu takes an optional argument called menu, which will fetch any menu by name, slug or ID.

If you just want post objects (or anything but the menu HTML), wp_get_nav_menus is the way to go. Otherwise, use wp_nav_menu. If you need it to return the menu HTML instead of echoing, there's an argument for that as well: echo.

share|improve this answer
How in the world did I miss that? I guess I got sidetracked by "menu_id" ... which seems to only deal with menus within a theme location. Thanks a lot, Christopher. – dcolumbus Oct 10 '11 at 14:52

Well, it looks like I found what I need:


I find it odd that wp_get_nav_menus isn't documented in the Codex.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.