Black Friday Sale! Get up to $30 off GP Premium! Learn more ➝

Reply To: Menu on mobile

Home Forums Support Menu on mobile Reply To: Menu on mobile

Home Forums Support Menu on mobile Reply To: Menu on mobile

#94649
Tom
Lead Developer
Lead Developer

Nice catch! I’ll have to fix this in the next version.

For now, you can add this code to your wp_footer hook:

<script type="text/javascript">
	jQuery(window).load(function($) {
		var mobile, widthSecondaryTimer;
		mobile = jQuery( '.menu-toggle' );
			
		function generateCheckSecondaryWidth() {
			if ( mobile.is( ':visible' ) ) {
				jQuery('.secondary-navigation').insertAfter('.main-navigation');
			} else {
				jQuery('.secondary-navigation').appendTo('.gen-sidebar-secondary-nav');
			}
		}
			
		if ( mobile.is( ':visible' ) ) {
			generateCheckSecondaryWidth();
		}
			
		jQuery(window).resize(function() {
			clearTimeout(widthSecondaryTimer);
			widthSecondaryTimer = setTimeout(generateCheckSecondaryWidth, 100);
		});
	});
</script>