Created
April 27, 2013 12:12
-
-
Save idavinder/5472896 to your computer and use it in GitHub Desktop.
Add new Widget are on homepage under the header
This file contains hidden or 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 new widget under header on homepage in Genesis theme | basicwp.com/add-new-widget-genesis-homepage/ */ | |
genesis_register_sidebar( array( | |
'id' => 'homepage-feature', | |
'name' => __( 'Homepage Feature', 'custom' ), | |
'description' => __( 'This is Homepage feature section', 'custom' ), | |
) ); | |
/** Top Homepage feature section */ | |
add_action( 'genesis_after_header', 'news_homepage_feature', 9 ); | |
function news_homepage_feature() { | |
if ( is_home() && is_active_sidebar( 'homepage-feature' ) ) { | |
echo '<div class="homepage-feature">'; | |
dynamic_sidebar( 'homepage-feature' ); | |
echo '</div><!-- end .homepage-feature -->'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment