From
Navigation Menus
https://codex.wordpress.org/Navigation_Menus
- We Register Menus
First, in your theme's functions.php, you need to write a function to register the names of your menus. (This is how they will appear in the Appearance -> Menus admin screen.) As an example, this menu would appear in the "Theme Locations" box as "Header Menu".
- function register_my_menu() {
- register_nav_menu('header-menu',__( 'Header Menu' ));
- add_action( 'init', 'register_my_menu' );
And this would make two menu options appear, header menu and extra menu -
- function register_my_menus() {
- 'header-menu' => __( 'Header Menu' ),
- 'extra-menu' => __( 'Extra Menu' )
- add_action( 'init', 'register_my_menus' );
2. We add to Theme
- <?php wp_nav_menu( array( 'theme_location' => 'header-menu' ) ); ?>