How can I show different menu for different pages?

You can try it this way. Now we are talking about pages you can set up a separate template for the page that needs a different menu. This where WordPress’s newer menu feature is really nice.

First if you are using the newer menu feature of WordPress place this in place of your current menu:

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

Next put this at the top of the template file that you are going to use for the page. This tells WordPress that this is a page template.

<?php
/*
 Template Name: Name your template here
*/
?>

Then place this in your template where your menu should go for this template:

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

Now we have to make sure that they will be activated. In your theme’s functions.php file you will need to place this:

// This theme uses wp_nav_menu() in two locations.  
register_nav_menus( array(  
  'primary' => __( 'Primary Navigation', 'your_theme_name' ),  
  'template_menu' => __('Template Navigation', 'your_theme_name')  
) ); 

Once this is all done all you need to do is go to your dashboard > Appearance > Menu
and create your menus there. Once created save then on the left it will give you the option of where to place which menu where via the drop downs.

After all this is set up when you set up a new page all you have to do is select the template you want to use.

I hope this helps if you have questions just ask.

Leave a Comment