Reply To: Mobile menu above header

Home Forums Support Mobile menu above header Reply To: Mobile menu above header

#166323
Tom
Lead Developer
Lead Developer

Nice site!

You could technically use some javascript for this.

Paste this block of code into the wp_footer hook “Appearance > GP Hooks”:

<script>
jQuery(document).ready(function($) {
	var mobile, widthTimer;
	mobile = jQuery( '.menu-toggle' );
			
	function generateMoveNav() {
		if ( mobile.is( ':visible' ) ) {
			jQuery('.main-navigation').insertBefore('.site-header');
		} else {
			jQuery('.main-navigation').insertAfter('.site-header');
		}
	}
			
	if ( mobile.is( ':visible' ) ) {
		generateMoveNav();
	}
			
	jQuery(window).resize(function() {
		clearTimeout(widthTimer);
		widthTimer = setTimeout(generateMoveNav, 100);
	});
});
</script>
  • This reply was modified 5 years, 3 months ago by Tom.