GeneratePress
We find Max Mega Menu works well with GeneratePress “out of the box”. However, if you are experiencing issues with residual styling, please follow the steps below.
Fix Residual Theme Styling
First create and activate a Child Theme.
In the child theme functions.php file, add the following:
1 2 3 4 5 6 7 8 9 10 11 12 |
function megamenu_remove_main_navigation_class( $classes ) { $new_classes = array(); foreach ($classes as $class) { if ($class != 'main-navigation') { $new_classes[] = $class; } } return $new_classes; } add_filter("generate_navigation_class", "megamenu_remove_main_navigation_class", 11); |
Applying a background colour to the navigation row
To restore the background color, go to Appearance > Customize > Additional CSS and add the following:
1 2 3 |
#site-navigation { background-color: #222222; } |
Making the menu full width
The menu position can be changed using the GeneratePress theme options.
Go to Appearance > Customize > Layout > Primary Navigation and set Navigation Location to “Below Header”.
Hide the theme logo
If you have added your logo directly to the menu, go to Appearance > Customize > Additional CSS and add the following:
1 2 3 |
header#masthead { display: none; } |
GeneratePress Premium
If you are using the Secondary Menu location, add the following to your themes functions.php file to fix the residual styling issues:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
function megamenu_remove_secondary_navigation_class( $classes, $class ) { if ( function_exists("max_mega_menu_is_enabled") && max_mega_menu_is_enabled("secondary") ) { $new_classes = array(); foreach ($classes as $class) { if ($class != 'secondary-navigation') { $new_classes[] = $class; } } return $new_classes; } return $classes; } add_filter("generate_secondary_navigation_class", "megamenu_remove_secondary_navigation_class", 11, 2); |