Skip to content

Instantly share code, notes, and snippets.

@chrisegg
Last active January 1, 2016 08:19
Show Gist options
  • Save chrisegg/8117498 to your computer and use it in GitHub Desktop.
Save chrisegg/8117498 to your computer and use it in GitHub Desktop.
Adds a widget area below header in Genesis child theme (Step 1 of 3)Usage: Place the following code in your themes functions.php file.
/**
* Add Page Title Widget Area Below Header.
*
* author ChrisEgg
* http://chriseggleston.com
* license GPL-2.0+
*/
//* Add the Page Title section
add_action( 'genesis_after_header', 'cegg_pagetitle' );
function cegg_pagetitle() {
if (is_active_sidebar( 'pagetitle' )) {
genesis_widget_area( 'pagetitle', array(
'before' => '<div class="pagetitle widget-area"><div class="wrap"',
'after' => '</div></div>'
) );
}
}
//* Register widget areas
genesis_register_sidebar( array(
'id' => 'pagetitle',
'name' => __( 'Page Title', 'cegg' ),
'description' => __( 'This is the page title section.', 'cegg' ),
) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment