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 used wp menus in the past but always registering a location and then using:

<?php wp_nav_menu( array( 'theme_location' => 'header-menu' ) ); ?>

To display a menu on that location on my theme I would first create a menu, and then assign it to that location.

Well now what I would like to do is to create all the menus I want using some standard name like my-menu-1, my-menu-2, my-menu-x. And then I want to display those menus on my theme but without using any location, just printing them using code identifying them by name.

How could I do that?

share|improve this question
General notice: If you are developing a theme for distribution, you should use theme location not menu name. See this post by Chip Bennett. – Stephen Harris Apr 22 '12 at 11:09
up vote 0 down vote accepted

Umm u can do that easily. And this is the way I do

how i register my menu in function.php

add_action('init', 'register_custom_menu'); 
function register_custom_menu() {
register_nav_menu('custom_menu', __('Custom Menu'));

Then in ur admin panel u create different the menu by ur disired name. And get the menu where ever u want like this. EX:- if I made two menu name "Menu 1" and "Menu 2"

wp_nav_menu(array('menu' => 'Menu 1'));
wp_nav_menu(array('menu' => 'Menu 2'));
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.