I'm using a theme based on underscores, and I have registered my menus in the following way.
function register_my_menu() {
register_nav_menus( array(
'primary' => esc_html__( 'Primary' ),
'social_media' => esc_html__( 'Social Media' ),
) );
};
add_action( 'init', 'register_my_menu' );
When calling the menus like so:
wp_nav_menu(
['theme_location' => 'primary']
);
wp_nav_menu(
['theme_location' => 'social_media']
);
only the primary menu shows up.
I checked if themenu exists and is registered with has_nav_menu()
and it returns true
.
Here is my backend. The menu is registered and assigned to a location:
No, it's not on display none. I checked the markup, and it's empty.
I disabled JS and it's still the same. I tried adding a new menu:
…
'secondary' => esc_html__( 'Secondary' ),
…
and went through all the procedure, and when calling
wp_nav_menu(
['theme_location' => 'secondary']
);
nothing happens. Markup is still empty. Somehow it's only working with the name 'primary'
secondary
menu?