custom menu duplicating items from one menu to the other.
-
I have two custom menus going in a footer.
When I was using this <?php ( wp_nav_menu (‘Footer-nav’) ) ?> to call each menu the same menu items were getting rendered for each location.When I used this: <?php wp_nav_menu( array( ‘container’ =>”,’fallback_cb’ => ”, ‘depth’ => 1, ‘theme_location’ => ‘Footer-two’ ) ); ?> for one menu it renders correctly in the correct location. But.. the other custom footer menu being called with <?php ( wp_nav_menu (‘Footer-nav’) ) ?> also renders the links from the “Footer-two”.
I have them both registered, both have menu items.
Under each location the correct men is selected. What is the proper way to call two custom menus that are in two different divs?This is the function:
add_action( 'init', 'my_custom_menus' ); function my_custom_menus() { register_nav_menus( array( 'Footer-nav' => __( 'Footer-nav' ), 'Footer-two' => __( 'Footer-two' ) ) ); }
This is the call in the footer:
<div id="footernavone"> <?php ( wp_nav_menu ('Footer-nav') ) ?> </div> <div id="footernavtwo"> This is footer two <?php wp_nav_menu( array( 'container' =>'','fallback_cb' => '', 'depth' => 1, 'theme_location' => 'Footer-two' ) ); ?> </div>
- The topic ‘custom menu duplicating items from one menu to the other.’ is closed to new replies.