Constructo
Constructo is a particularly difficult theme to integrate Max Mega Menu with. It requires editing theme PHP files which cannot be placed within a child theme, therefore, these changes will need to be reapplied if the theme gets updated.
Step 1
This step requires editing a PHP file. It’s important to be extra careful and take a backup of the file before editing it. It would be wise to make these changes on a local test site before uploading the changes to your live site.
Go to Appearance > Editor. Select “helpers.php” on the right.
Find (line 639):
1 |
<nav class="site-navigation<?php echo esc_attr($menu_description); ?> site-navigation-<?php echo $location; ?>"> |
Replace with:
1 |
<nav class="<?php echo esc_attr($menu_description); ?> site-navigation-<?php echo $location; ?>"> |
Note: The ‘site-navigation’ class is removed
Find (line 676):
1 2 3 4 5 6 7 8 9 10 11 12 |
wp_nav_menu( array( 'container' => false, 'menu_class' => '', 'echo' => true, 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'depth' => 0, 'walker' => $walker, 'menu'=>$menu )); |
Replace with:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
wp_nav_menu( array( 'container' => false, 'menu_class' => '', 'echo' => true, 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'depth' => 0, 'walker' => $walker, 'menu'=>$menu, 'theme_location' => 'primary' )); |
Note: The new ‘theme_location’ line and the comma after $menu.
Step 2
Go to Mega Menu > Menu Themes. In the Custom Styling area, paste in the following:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
@include desktop { .site-navigation-primary { display: block; float: right; } .site-navigation-primary #{$wrap} { float: left; } } @include mobile { .site-navigation-primary { clear: both; float: left; width: 100%; } } .navbar-toggle { display: none !important; } |