WordPress Custom Menu sidebar for different pages

152 views
asked Feb 26, 2013 in Website Builder by SunFun (3,000 points)
Hi all
I want to display different custom menus in the side bar of different pages and categories. To make it clear, I want to have different sidebar menus for every categorized page. I am using WordPress 2.5 . Can anyone please advice?
Thanks

2 Answers

0 like 0 dislike
answered Feb 26, 2013 by WebProX (12,200 points)
Use this code in your theme's file
<?php
if (is_page('3'){
wp_nav_menu(array('menu'=>'menu3', ));
} elseif (is_page(4)) {
wp_nav_menu(array('menu'=>'menu4' ));
}
?>
Or if you want more than one page to have the same menu use the below code :
is_page( array( 5, 6, 7 ) )
wp_nav_menu(array('menu'=>'menu5', ));
0 like 0 dislike
answered Feb 26, 2013 by WebProX (12,200 points)
You can use the Dynamic widgets plugin.
http://wordpress.org/extend/plugins/dynamic-widgets/
...