I've got the following usual menu registration function:
function my_register_menus(){
register_nav_menus( array(
'primary-menu' => __( 'Primary Menu', 'text_Domain' ),
'footer-menu' => __( 'Footer Menu', 'text_Domain' ),
) );
}
add_action( 'init', 'my_register_menus', 0 );
and this is what I call in my header.php
:
wp_nav_menu( array( 'theme_location' => 'primary-menu' ));
Now, in the
WP Admin > Nav Menus
when I assign a menu to the primary-menu
location, the menu doesn't show at all in the theme.
If I un-check the menu location, the menu appears.
function single_menu_reg() { register_nav_menu( 'primary-menu', __( 'Primary Menu', 'text_domain' ) ); } add_action( 'init', 'single_menu_reg', 0);
- this is just a test to see if something else is happening. As your code looks fine.register_nav_menu
menu function but nope, same behaviour: when I assign the menu to that location the menu disapper, if I uncheck the location for the menu, it appears again. That's weird, I can't figure out what I'm missing. I also use Polylang, so I thought that had something to do with it, but I don't know...