Top Shop
Sub menus within the Top Shop mobile menu will not work correctly when Max Mega Menu is enabled for the primary menu. The following change will disable the built in Top Shop mobile menu and display the standard Max Mega Menu instead. To avoid losing changes when the theme is updated, all edits should be made inside a child theme.
Edit: wp-content/themes/topshop/templates/header/header-layout-standard.php
Find (line ~92):
1 2 3 4 5 6 7 8 9 10 |
<nav id="site-navigation" class="main-navigation <?php echo ( get_theme_mod( 'topshop-sticky-header', false ) ) ? ' header-stick' : ''; ?>" role="navigation"> <span class="header-menu-button"><i class="fa fa-bars"></i><span><?php _e( 'Menu', 'topshop' ); ?></span></span> <div id="main-menu" class="main-menu-container"> <span class="main-menu-close"><i class="fa fa-angle-right"></i><i class="fa fa-angle-left"></i></span> <div class="site-container"> <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?> <div class="clearboth"></div> </div> </div> </nav><!-- #site-navigation --> |
Replace with:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
<?php if (function_exists('max_mega_menu_is_enabled') && max_mega_menu_is_enabled('primary') ): ?> <nav id="site-navigation" class="<?php echo ( get_theme_mod( 'topshop-sticky-header', false ) ) ? ' header-stick' : ''; ?>" role="navigation"> <div id="main-menu" class="main-menu-container"> <div class="site-container"> <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?> <div class="clearboth"></div> </div> </div> </nav><!-- #site-navigation --> <?php else: ?> <nav id="site-navigation" class="main-navigation <?php echo ( get_theme_mod( 'topshop-sticky-header', false ) ) ? ' header-stick' : ''; ?>" role="navigation"> <span class="header-menu-button"><i class="fa fa-bars"></i><span><?php _e( 'Menu', 'topshop' ); ?></span></span> <div id="main-menu" class="main-menu-container"> <span class="main-menu-close"><i class="fa fa-angle-right"></i><i class="fa fa-angle-left"></i></span> <div class="site-container"> <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?> <div class="clearboth"></div> </div> </div> </nav><!-- #site-navigation --> <?php endif; ?> |