Function — Add menu support and fallback menu - martindubenet/Wordpress GitHub Wiki

Add menu support and fallback menu if no menu have been created in the admin

http://www.scratch99.com/2010/06/practical-theme-support-for-wordpress-3-0-menus

functions.php

add_action('init', 'my_nav_menu');
function my_nav_menu() {
    if (function_exists('register_nav_menu')) {
        register_nav_menu('header-main', __('Header’s Main Menu', 'Dashboard custom'));
        register_nav_menu('footer-main', __('Footer’s Main Menu', 'Dashboard custom'));
    }
}
function my_nav_menu_fallback() {
    echo '<ul>'.wp_list_pages('sort_column=menu_order&title_li=').'</ul>';
}
⚠️ **GitHub.com Fallback** ⚠️