This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //do not include the opening tag! | |
| // Required Scripts and Styles | |
| add_action( 'wp_enqueue_scripts', 'leaven_load_scripts', 15 ); | |
| function leaven_load_scripts() { | |
| // Responsive Navigation | |
| wp_enqueue_style( 'fontawesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css', array(), '4.3.0' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Title: How to Add a Mobile-Friendly, Off Canvas Menu in Genesis | |
| Author: Calvin Makes (@calvin_makes) | |
| Link: http://www.calvinmakes.com/add-a-mobile-friendly-off-canvas-menu-in-genesis | |
| */ | |
| /* ## Animation Settings and Classes | |
| --------------------------------------------- */ | |
| .off-canvas-active { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Title: How to Add a Mobile-Friendly, Off Canvas Menu in Genesis | |
| Author: Calvin Makes (@calvin_makes) | |
| Link: http://www.calvinmakes.com/add-a-mobile-friendly-off-canvas-menu-in-genesis | |
| */ | |
| /* ## Genesis Navigation Menu | |
| --------------------------------------------- */ | |
| .genesis-nav-menu { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //* Do NOT include the opening PHP tag | |
| /** | |
| * Include the JavaScript | |
| * @author Calvin Makes (@calvin_makes) | |
| * @link http://www.calvinmakes.com/add-a-mobile-friendly-off-canvas-menu-in-genesis | |
| */ | |
| add_action( 'wp_enqueue_scripts', 'cm_load_menu' ); | |
| function cm_load_menu() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //* Do NOT include the opening PHP tag | |
| /** | |
| * Add the overlay div that will be used for clicking out of the active menu. | |
| * @author Calvin Makes (@calvin_makes) | |
| * @link http://www.calvinmakes.com/add-a-mobile-friendly-off-canvas-menu-in-genesis | |
| */ | |
| add_action( 'genesis_before', 'cm_site_overlay', 2 ); | |
| function cm_site_overlay() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //* Do NOT include the opening PHP tag | |
| /** | |
| * Add the menu to the .site-header, but hooking right before the genesis_header_markup_close action. | |
| * @author Calvin Makes (@calvin_makes) | |
| * @link http://www.calvinmakes.com/add-a-mobile-friendly-off-canvas-menu-in-genesis | |
| */ | |
| add_action( 'genesis_header', 'cm_menu_button', 14 ); | |
| function cm_menu_button() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //* Do NOT include the opening PHP tag | |
| /** | |
| * Reposition the Primary navigation at the top of the DOM. | |
| * @author Calvin Makes | |
| * @link http://www.calvinmakes.com/add-a-mobile-friendly-off-canvas-menu-in-genesis | |
| */ | |
| remove_action( 'genesis_after_header', 'genesis_do_nav' ); | |
| add_action( 'genesis_before', 'genesis_do_nav', 1 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //* Do NOT include the opening php tag shown above. Copy the code shown below. | |
| //* Add support for structural wraps | |
| add_theme_support( 'genesis-structural-wraps', array( | |
| 'header', | |
| 'nav', | |
| 'subnav', | |
| 'site-inner', | |
| 'footer-widgets', |
NewerOlder