Last active
May 1, 2021 09:07
-
-
Save JanHoek/c71ff85d0220d47f4453 to your computer and use it in GitHub Desktop.
Pure CSS Responsive Menus For Genesis
This file contains 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 //* Don't copy the php | |
//* Activate the use of Dashicons | |
add_action( 'wp_enqueue_scripts', 'load_dashicons_front_end' ); | |
function load_dashicons_front_end() { | |
wp_enqueue_style( 'dashicons' ); | |
} | |
//* Add Extra div to nav for responsive menu | |
add_filter('wp_nav_menu','jan_responsive_nav', 10, 3); | |
function jan_responsive_nav( $nav, $args ) { | |
if( $args->theme_location == 'primary') { | |
return '<input type="checkbox" id="toggle" /><div><label for="toggle" class="toggle" data-open="Open Menu" data-close="Close Menu" onclick></label>' . $nav . '</div>'; | |
} | |
return $nav; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
damtn its what i am looking for and not found in hours!
great and thx. so i dont have to build pure css menu from scratch 👯♂️