Skip to content

Instantly share code, notes, and snippets.

@srikat
Last active April 16, 2019 14:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srikat/b130b0b280e4cb51cc2e50c7d8ffe5ca to your computer and use it in GitHub Desktop.
Save srikat/b130b0b280e4cb51cc2e50c7d8ffe5ca to your computer and use it in GitHub Desktop.
How to add a full width element inside Genesis header. https://sridharkatakam.com/add-full-width-element-inside-genesis-header/
// Remove default header opening markup function
remove_action( 'genesis_header', 'genesis_header_markup_open', 5 );
// Add back header opening markup function w/o the structural wrap
add_action( 'genesis_header', 'sk_header_markup_open', 5 );
function sk_header_markup_open() {
genesis_markup( array(
'html5' => '<header %s>',
'xhtml' => '<div id="header">',
'context' => 'site-header',
) );
// genesis_structural_wrap( 'header' );
}
// Add toolbar inside header
add_action( 'genesis_header', 'sk_toolbar', 7 );
function sk_toolbar() {
echo "toolbar code comes here";
// Maybe add opening .wrap div tag with header context.
genesis_structural_wrap( 'header' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment