Skip to content

Instantly share code, notes, and snippets.

@About2git
Forked from srikat/functions.php
Created February 15, 2015 22:20
Show Gist options
  • Save About2git/34499d693bbc6320f543 to your computer and use it in GitHub Desktop.
Save About2git/34499d693bbc6320f543 to your computer and use it in GitHub Desktop.
Making Utility Bar and Header fixed in Agency Pro
// 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>';
}
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 );
/* 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