Change menu displayed with menu toggle
-
Hi Guys,
I’ve been searching for an answer to this but have had no luck and Im hoping someone can help.
I currently have 3 menus for my site, lets call them A, B and C for ease. Menus A and B show up on the normal desktop version of the site, while menu C (a combination of both menus A and B) is not used.
Then when the screen is reduced for mobiles and tablets etc I hide menus A and B using media queries and use menu toggle to display a mobile friendly menu.
The problem however is that I want the menu that is displayed using menu toggle to be menu C but at present it is defaulting to menu A.
The code I am using is as follows:
<nav id="site-navigation" class="navigation main-navigation" role="navigation"> <a class="screen-reader-text skip-link" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentythirteen' ); ?>"><?php _e( 'Skip to content', 'twentythirteen' ); ?></a> <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?> <h3 class="menu-toggle"><?php _e( 'Menu', 'twentythirteen' ); ?></h3> </nav>
I’ve tried the following:
<h3 class="menu-toggle"><?php wp_nav_menu( array( 'theme_location' => 'small-screen-nav-menu', 'menu_class' => 'nav-menu' ) ); _e('Menu'); ?> </h3>
and this shows up menu C (which is the small-screen-nav-menu in reality) but before menu C it still shows menu A!?
How can I get rid of menu A and just use menu C (small-screen-nav-menu)?
I am using a child theme of twentythirteen and have defined the theme name as: Ecoexplore in the style.css file and the text domain as: ecoexplore but changing
<h3 class="menu-toggle"><?php _e( 'Menu', 'twentythirteen' ); ?></h3>
to
<h3 class="menu-toggle"><?php _e( 'Menu', 'ecoexplore' ); ?></h3>
or
<h3 class="menu-toggle"><?php _e( 'Menu', 'Ecoexplore' ); ?></h3>
Doesn’t seem to work.
Any help would be much appreciated!
- The topic ‘Change menu displayed with menu toggle’ is closed to new replies.