Wrong menu being displayed by wp_nav_menu()
-
Hi,
Firstly I hope this is posted in the right forum!I’m creating my own theme and I’ve added menu support, but I’m having trouble with the wrong menu being displayed.
In functions.php I have
add_action( 'init', 'roganty2_menus' ); function roganty2_menus(){ register_nav_menus( array( 'main-menu' => 'Main Menu' ) ); }
In header.php I have
<?php wp_nav_menu( array('theme-location' => 'main-menu', 'container' => false, 'depth' => 1) ); ?>
In the back end I have two menus, ‘Long Menu’ and ‘Short Menu’
I have selected ‘Short Menu’ to be in the ‘Main Menu’ location, but it only displays ‘Long Menu’.The only way it displays ‘Short Menu’ is if I delete ‘Long Menu’. As soon as I recreate ‘Long Menu’ it starts displaying ‘Long Menu’ again!
Other things I have tried:
- Deleting cache
- Renaming ‘Short Menu’ to ‘Main Menu’
Has anyone got any ideas??
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Wrong menu being displayed by wp_nav_menu()’ is closed to new replies.