Leaven Responsive Menu
This project consists of four elements:
- CSS: the project includes both the Sass partials and a compiled style.css. You can add the partials to your own project and import per your workflow, or copy/paste the style.css contents into your theme stylesheet, replacing all navigation styles. Only navigation location specific styling should be needed beyond what's in this project.
- Sprites: the sprites in the code are from the Font Awesome free SVG icons. You can use these or replace them with your own. The code in the svg.php file expects the icons to be in the /sprites folder.
- PHP: five individual files are included, some of which are optional. You can either copy the individual files to your theme and include them, or copy the individual functions into your functions.php file.
navigation.php: sets up the script and localization variables for the responsive menu.
navigation-search.php: adds a search input to the primary navigation menu
svg.php: function to add SVG icons to menus, search forms, etc.
svg-navigation.php: function to scan a social menu and add SVG icons automatically, if possible.
Frequently Asked Questions
How do I tell the theme about a mobile menu plugin?
leaven_get_navigation_localization_args function, look for the
$desktop_only variable. It's currently set to check for SuperSide Me:
// optional: set the menu script to perform on desktop only. set to false to use the mobile menu, too $desktop_only = (bool) function_exists( 'supersideme_has_content' ) && supersideme_has_content();
If SuperSide Me is not active, it will be
false. You can change this variable to anything you like, and check for any mobile menu plugin you prefer to use.
- initial release