Last active
March 22, 2017 05:41
-
-
Save studiopress/6671322 to your computer and use it in GitHub Desktop.
Sticky menu.
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 | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* Enqueue sticky menu script | |
add_action( 'wp_enqueue_scripts', 'sp_enqueue_script' ); | |
function sp_enqueue_script() { | |
wp_enqueue_script( 'sample-sticky-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/sticky-menu.js', array( 'jquery' ), '1.0.0' ); | |
} | |
//* Reposition the secondary navigation menu | |
remove_action( 'genesis_after_header', 'genesis_do_subnav' ); | |
add_action( 'genesis_before', 'genesis_do_subnav' ); |
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
/* Secondary Navigation | |
--------------------------------------------- */ | |
.nav-secondary { | |
background-color: #333; | |
display: none; | |
position: fixed; | |
top: 0; | |
width: 100%; | |
z-index: 999; | |
} | |
.nav-secondary .genesis-nav-menu a { | |
padding: 20px; | |
} | |
.nav-secondary .genesis-nav-menu .sub-menu a { | |
padding: 16px 20px; | |
} | |
.nav-secondary a:hover, | |
.nav-secondary .current-menu-item > a, | |
.nav-secondary .menu-item-home > a, | |
.nav-secondary .menu-item-home > a:hover { | |
color: #fff; | |
} | |
.nav-secondary .sub-menu a:hover { | |
color: #333; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment