Skip to content

Instantly share code, notes, and snippets.

@braddalton
Last active December 17, 2015 23:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save braddalton/5690103 to your computer and use it in GitHub Desktop.
Save braddalton/5690103 to your computer and use it in GitHub Desktop.
genesis_register_sidebar( array(
'id' => 'home-slider',
'name' => __( 'Home Slider', 'child theme' ),
'description' => __( 'This is the slider widget area for your homepage.', 'child theme' ),
) );
/**
* @author Brad Dalton - WP Sites
* @learn more http://wp.me/p1lTu0-9p4
*/
add_action( 'genesis_before_content_sidebar_wrap', 'widget_before_content_home_page');
function widget_before_content_home_page() {
if ( is_home() && is_active_sidebar( 'home-slider' ) ) {
echo '<div id="home-slider">';
dynamic_sidebar( 'home-slider' );
echo '</div><!-- end #home-slider -->';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment