Secondary wp_nav_menu repeating first
-
I’m having a very weird issue with creating multiple menu’s. I’ve performed all of the steps for creating multiple menu’s on a website, and have called them in my header file, one after the other, using the wp_nav_menu() function. However, after calling them, only firs menu appears, and it is repeated, regardless of what I place as the secondary menu. The only way I’ve gotten to this work appropriately is by declaring the actual names of the menu’s thru wp_nav_menu(array=’Menu Name’); But that only works if the menu is called “Menu Name”. I’m quite confused and feel as if I’m doing something very wrong here. here is my code snippits, and please tell me if I’m doing anything wrong in the way I’m declaring these two seperate menus.
functions.php
/* Menu Registration */ add_action('init', 'register_my_menus'); function register_my_menus() { register_nav_menus( array ( 'primary' => __('Top Menu'), 'secondary' => __('Bottom Menu')) ); }
header.php
<?php wp_nav_menu(array('container' => 'div', 'container_id' => 'top-nav', 'menu_class' => 'nav', 'fallback_cb' => false, 'theme_location' => 'primary')); ?> <?php wp_nav_menu(array('container' => 'div', 'container_id' => 'second-nav', 'menu_class' => 'nav', 'fallback_cb' => false, 'theme-location' => 'secondary')); ?>
- The topic ‘Secondary wp_nav_menu repeating first’ is closed to new replies.