Snippet: Disable the Header Style One Mega Menu Full-Width Script
Important: You can now control this via the Customizer under Header > Mega Menus > Full-width
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 Code Snippets (100% Free) or WPCode (sponsored)
We recommend Code Snippets (100% Free) or WPCode (sponsored)