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 have three main directories in my site, and I'm wanting to display one unique menu for each directory and display it on each child of that directory. I'm thinking I create my three custom menus, but then what would be the best way to display the correct one for each section?

Thanks for your help!

share|improve this question

Yes, create 3 custom menus and use a conditional.

Example you have 3 custom menus named, Products, Services,Training.

Open the section of the page you want to insert code in the header.php or where ever you need it. file and use:

if (is_page( array( 42, 'Products' ) )) {
  wp_nav_menu('menu' => 'Products');
}elseif(is_page( array( 2, 'Services' ) )) {
  wp_nav_menu('menu' => 'Services');
}elseif(is_page( array( 42, 'Training' ) )) {
  wp_nav_menu('menu' => 'Training');
}else {

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.