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'm using the _s theme and seeing the header menu point to 'Home' and 'Sample page'.

in functions.php, we have

register_nav_menus( array(
  'primary' => __( 'Primary Menu', 'mytheme' ),
  'secondary' => __( 'Secondary Menu', 'mytheme' ),
) );

Then in header.php, we use

<?php wp_nav_menu( array( 'theme_location' => 'Primary Menu' ) ); ?>
<?php wp_nav_menu( array( 'theme_location' => 'Secondary Menu' ) ); ?>

etc.

Finally, we have created both menus in the Wordpress custom menu section and added some custom items, but they are not reflected in the site. How do we match them up?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

You should be calling the menus by name, not description:

<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
<?php wp_nav_menu( array( 'theme_location' => 'secondary' ) ); ?>
share|improve this answer
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.