Here are some valuable functions to activate the new Wordpress 3.0 menu system in your theme.
//This adds menu support, use in the functions.php file
register_nav_menus(
array(
'header-menu' => __( 'Header Menu' ),
'footer-menu' => __( 'Footer Menu' ),
)
);
// if no menu pressent fallback to.... used in wp_nav_menu
function header_fallback() {
echo '<div class="sf-menu-wrapper group"><ul class="sf-menu">';
wp_list_pages('title_li=');
echo '</ul></div>';
}
function footer_fallback() {
echo '<div id="footer-nav-wrapper" class="group"><ul id="footer-nav">';
wp_list_pages('depth=1&title_li=');
echo '</ul></div>';
}
//This snippet is the one you put where you want to display the menu
<?php wp_nav_menu(array('theme_location'=>'header-menu','container_class'=>'sf-menu-wrapper group','menu_class'=>'sf-menu','fallback_cb'=>'header_fallback')); ?>
<?php wp_nav_menu(array('theme_location'=>'footer-menu','container_id'=>'footer-nav-wrapper','container_class'=>'group','menu_id'=>'footer-nav','fallback_cb'=>'footer_fallback')); ?>
