Skip to content

Instantly share code, notes, and snippets.

@ryantownley
Last active May 19, 2016 03:04
Show Gist options
  • Save ryantownley/617aa2215e930b564b23 to your computer and use it in GitHub Desktop.
Save ryantownley/617aa2215e930b564b23 to your computer and use it in GitHub Desktop.
This code snippet will add a "Page Header" widget area to your Genesis child theme below the header and outside the wrap. It will show site-wide by default, however, you can use a widget visibility plugin such as included in Jetpack to hide or show the widget in certain areas of your site.
//* Register Page Header
genesis_register_sidebar( array(
'id' => 'page-header',
'name' => __( 'Page Header', 'genesis' ),
'description' => __( 'This is the Page Header area.', 'Genesis' ),
) );
//* Add the Page Header
add_action( 'genesis_after_header', 'genesis_page_header' );
function genesis_page_header() {
genesis_widget_area( 'page-header', array(
'before' => '<div class="page-header">',
'after' => '</div>',
) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment