My navigation menus are stuck!
-
I’m creating a theme where I’m using two menus in the header. One menu is called “Primary” and the other is called “Secondary”. After I’ve registered the two menus in functions like so:
function azb_menu() { register_nav_menus( array( 'primary' => __( 'Primary Menu' ), 'secondary' => __( 'Secondary Menu' ) ) ); } add_action( 'init', 'azb_menu' );
then called it in my header.php like so:
<div class="primary"> <?php wp_nav_menu( array( 'theme_location' => 'Primary Menu' ) ); ?> </div> <div class="secondary"> <?php wp_nav_menu( array( 'theme_location' => 'Secondary Menu' ) ); ?> </div>
I get duplicated “Sample Page” in both menus. When I looked at the source I found that the html is exactly the same. This is the source:
<div class="primary"> <div class="menu"> <ul> <li class="page_item page-item-2"><a href="https://azb2.local/sample-page/">Sample Page</a> </li> </ul> </div> </div> <div class="secondary"> <div class="menu"> <ul> <li class="page_item page-item-2"><a href="https://azb2.local/sample-page/">Sample Page</a> </li> </ul> </div> </div>
Not sure what in heck is going on, but I can’t figure out why they are the same, and why, when I add new items to the menu they aren’t showing up!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘My navigation menus are stuck!’ is closed to new replies.