I've written a massive blog post explaining this code.
A few things that are included in this gist, that might not be immediately obvious and will prevent this code from being a simple copy and paste
- There are a few references to the Susy grid.
- I've also referenced a few of my Sass go to mixins and extends. I've written a post about these, too.
- There are a few references to color variables, I reference in a separate _theme.scss file.
There's quite a bit of setup required in WordPress, in order for this code to work. Again, this is explained within the blog post.
// if 'mega-menu' exists within the class
if ( in_array('is-mega-menu', $item->classes)) {
?>
unset($second_level); ?>
unset($third_level); ?>
This is what I am trying but I cannot get it to work correctly to display the third level. If you have any idea on a different way or something I am missing it would be greatly appreciated.