register_nav_menus, then create menus programatically
There is no need to create/update custom menus programmatically, just to do what you’re trying to do. Just rely on the wp_nav_menu() fallback, wp_page_menu(), or define your own, custom callback, e.g. to output wp_list_pages(). Calling this: `wp_nav_menu( array( ‘theme_location’ => ‘main-nav’ ) );` …will, if no custom menu has been assigned to the ‘main-nav’ theme … Read more