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 want two menus using the new WordPress 3.0 feature.

In functions.php I have:

function register_my_menus() {
     'header-menu' => __( 'Header Menu' ),
     'top-menu' => __('Top Menu')

add_action( 'init', 'register_my_menus' );

And in header.php I have:

<?php wp_nav_menu( array( 'name' => 'Header Menu' ) ); ?>
<?php wp_nav_menu( array( 'name' => 'Top Menu' ) ); ?>

Now they seem to fallback or something, always showing the same menu. The menus have been defined and setup in wp-admin "theme-locations".

Why won't they load appropriately?

share|improve this question
up vote 2 down vote accepted

wp_nav_menu() does not have a name argument. Instead, you should use theme_location.

With register_nav_menus(), you indicate that you have two locations in your theme where you can display a menu. The user can then create multiple menus, and assign them to these locations. This is why we have the indirection via theme_location. If you know the ID, slug or name of the menu you want to use, you can use the menu argument of wp_nav_menu().

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.