Last active
January 3, 2016 10:39
-
-
Save srikat/8450646 to your computer and use it in GitHub Desktop.
Making Utility Bar and Header fixed in Agency Pro. http://sridharkatakam.com/make-utility-bar-header-fixed-agency-pro/
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
// Wrap Utility Bar and Header in a custom div | |
add_action( 'genesis_before_header', 'sk_opening_div', 9 ); | |
function sk_opening_div() { | |
echo '<div class="my-site-header">'; | |
} | |
add_action( 'genesis_after_header', 'sk_closing_div', 9 ); | |
function sk_closing_div() { | |
echo '</div>'; | |
} |
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
remove_action( 'genesis_header', 'genesis_header_markup_open', 5 ); | |
remove_action( 'genesis_header', 'genesis_do_header' ); | |
remove_action( 'genesis_header', 'genesis_header_markup_close', 15 ); | |
add_action( 'genesis_before', 'genesis_header_markup_open', 5 ); | |
add_action( 'genesis_before', 'genesis_do_header', 10 ); | |
add_action( 'genesis_before', 'genesis_header_markup_close', 15 ); |
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
/* Fixed Header Area */ | |
.site-header { | |
position: static; | |
} | |
@media only screen and (min-width: 568px) { | |
.site-container { | |
padding-top: 0; | |
padding-top: 0; | |
} | |
.my-site-header { | |
position: fixed; | |
top: 0; | |
left: 0; | |
z-index: 1000; | |
width: 100%; | |
max-width: 100%; | |
} | |
.admin-bar .my-site-header { | |
top: 28px; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment