X Theme
You will see a duplicate Mobile Toggle button on smaller screens after enabling Max Mega Menu for the primary menu. To work around this issue, go to Mega Menu > Menu Themes and enable the ‘Disable Mobile Toggle’ option.
Alternatively, if you would like to remove the theme mobile toggle button, and use the full Max Mega Menu mobile menu instead, you will need to edit the following file:
/wp-content/themes/x/framework/views/global/_nav-primary.php
Find:
1 |
if( function_exists( 'ubermenu' ) && $config_id = ubermenu_get_menu_instance_by_theme_location( 'primary' ) ): |
Replace with:
1 2 3 4 |
if ( function_exists('max_mega_menu_is_enabled') && max_mega_menu_is_enabled('primary') ) { wp_nav_menu( array( 'theme_location' => 'primary' ) ); } else if( function_exists( 'ubermenu' ) && $config_id = ubermenu_get_menu_instance_by_theme_location( 'primary' ) ): |
The full contents of the file (as of X v4.6.4) should be:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
<?php // ============================================================================= // VIEWS/GLOBAL/_NAV-PRIMARY.PHP // ----------------------------------------------------------------------------- // Outputs the primary nav. // ============================================================================= if ( function_exists('max_mega_menu_is_enabled') && max_mega_menu_is_enabled('primary') ) { wp_nav_menu( array( 'theme_location' => 'primary' ) ); } else if( function_exists( 'ubermenu' ) && $config_id = ubermenu_get_menu_instance_by_theme_location( 'primary' ) ): ubermenu( $config_id, array( 'theme_location' => 'primary') ); else: ?> <a href="#" class="x-btn-navbar collapsed" data-toggle="collapse" data-target=".x-nav-wrap.mobile"> <i class="x-icon-bars" data-x-icon=""></i> <span class="visually-hidden"><?php _e( 'Navigation', '__x__' ); ?></span> </a> <nav class="x-nav-wrap desktop" role="navigation"> <?php x_output_primary_navigation(); ?> </nav> <div class="x-nav-wrap mobile collapse"> <?php x_output_primary_navigation(); ?> </div> <?php endif; ?> |