Registering second menu has overridden previous menu as well
-
I registered a second menu in my functions file like so
add_theme_support( 'menus' ); function register_theme_menus() { register_nav_menus( array( 'header-menu' => __('Header Menu'), 'markets-nav' => __('Markets Menu') ) ); } add_action('init', 'register_theme_menus');and added the menu to a sidebar location
<?php $args = array( 'menu' => 'markets-nav', 'menu_class' => 'sidebar-nav', 'container' => 'false' ); wp_nav_menu( $args ); ?>But when I assign it in wordpresses back end the new menu shows up in the sidebar but also in the header in place of my original menu.
Here is the code in the header<?php $args = array( 'menu' => 'header-menu', 'menu_class' => 'nav navbar-nav flex-nav', 'container' => 'false' ); wp_nav_menu( $args ); ?>What am I missing here?
-
These forums are for folks hosted on WordPress.com.
For help with a self-hosted site, try the WordPress.org theme forums:
https://wordpress.org/support/forum/themes-and-templates
You’ll need a free WordPress.org account to post – if you don’t already have one, you can register here:
https://wordpress.org/support/register.php
or WordPress Development at Stack Overflow:
- The topic ‘Registering second menu has overridden previous menu as well’ is closed to new replies.