Created
March 17, 2014 18:31
-
-
Save mjsdiaz/9605372 to your computer and use it in GitHub Desktop.
Mobile Responsive Header Menu for Genesis Sample Theme --- http://amethystwebsitedesign.com/mobile-responsive-header-menu-for-genesis-sample-theme/
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 | |
// Note: Add only code below to your functions.php | |
add_action( 'wp_enqueue_scripts', 'amethyst_enqueue_scripts' ); | |
function amethyst_enqueue_scripts() { | |
//Add mobile button script to Header Right widget navigation menu | |
wp_enqueue_script( 'header_nav_for_mobile', get_bloginfo( 'stylesheet_directory' ) . '/scripts/header-mobile-nav.js', array('jquery'), '1.0.0' ); | |
} |
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
/* Add to the bottom of child theme styles.css */ | |
@media only screen and (max-width: 768px) { | |
/* Start Header Right Widget Mobile Menu Navigation | |
--------------------------------------------------- */ | |
.nav-header .genesis-nav-menu.hide { | |
display: none; | |
} | |
#header-mobile-menu { | |
color: #999; | |
cursor: pointer; | |
display: block; | |
font-family: Lato, sans-serif; | |
font-size: 18px; | |
font-size: 1.8rem; | |
height: auto; | |
line-height: 18px; | |
padding: 20px 16px; | |
padding: 2rem 1.6rem; | |
text-align: center; | |
text-transform: uppercase; | |
} | |
#header-mobile-menu:hover, | |
#header-mobile-menu:focus, | |
#header-mobile-menu:active { | |
color: #333; | |
display: block; | |
} | |
.nav-header .genesis-nav-menu .menu-item, | |
.nav-header .genesis-nav-menu a, | |
.nav-header .genesis-nav-menu .sub-menu { | |
border: 0; | |
text-align: center; | |
width: 100%; | |
} | |
.nav-header .genesis-nav-menu .menu-item > .sub-menu { | |
clear: both; | |
margin: 0; | |
opacity: 1; | |
position: inherit; | |
width: 100%; | |
} | |
} | |
@media only screen and (min-width: 769px) { | |
/* This makes the header nav menu normal again when the browser window expands */ | |
.nav-header .genesis-nav-menu { | |
display: block !important; | |
height: auto; | |
} | |
/* Hide Header Mobile Menu Button */ | |
#header-mobile-menu { | |
display: none; | |
height: 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment