Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I try to display multiple menus but Wordpress keep always display the first one I created...

Here is all the code about the menus:

functions.php

<?php function custom_init(){

  register_nav_menus(
    array(
      'header_quick_links' => __( 'Liens rapides du header' ),
      'header_menu'        => __( 'Menu du header' )
    )
  );

}

add_action('init', 'custom_init');

header.php

<?php wp_nav_menu(array(
  'menu'       => 'header_quick_links',
  'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
  'container'  => '',
  'menu_class' => 'header_quick_list'
)); ?>
...
<?php wp_nav_menu(array(
  'menu'       => 'header_menu',
  'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
  'container'  => '',
  'menu_class' => 'header_menu_list'
)); ?>

And in the admin, each menu is correctly assign to the good location...

Any idea ?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You are mismatching argument and input.

In rather confusingly worded way register_nav_menus() creates menu locations rather than actual menus. While menu argument in wp_nav_menu() expects menu as created in admin.

Since you seem to want to display menu, assigned to specific location, change menu in arguments to theme_location.

share|improve this answer
    
Oh yes, that was it. Thank you :) –  Axiol Sep 12 '13 at 18:16
add comment

Your Answer

 
discard

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.