Skip to content

Snippet: Disable the header style one megamenu full-width script

When using header sytle one by default the theme adds javascript so that your megamenu expands full-width so it's always the width of your header. However, you can easily disable that via the code below added to your child theme's functions.php file. While you can use CSS for this, actually disabling the javascript is more efficient.

add_filter( 'wpex_localize_array', function( $array ) {
	$array['megaMenuJS'] = false;
	return $array;
} );
All PHP snippets should be added via child theme's functions.php file or via a plugin (we recommend WPCode)
Back To Top