Skip to content

Instantly share code, notes, and snippets.

@ryantownley
Last active May 19, 2016 03:03
Show Gist options
  • Save ryantownley/ce6bde59b92b7edfc126 to your computer and use it in GitHub Desktop.
Save ryantownley/ce6bde59b92b7edfc126 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 within 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"><div class="wrap">',
'after' => '</div></div>',
) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment