Last active
January 1, 2016 08:19
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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