Skip to content

Instantly share code, notes, and snippets.

/Slider Widget Secret

Created May 25, 2013 20:19
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 anonymous/9ec62bb36d2e5ef4688f to your computer and use it in GitHub Desktop.
Save anonymous/9ec62bb36d2e5ef4688f to your computer and use it in GitHub Desktop.
/** Register Home Slider Widget**/
genesis_register_sidebar( array(
'id' => 'home-slider',
'name' => __( 'Home Slider', 'wpsites' ),
'description' => __( 'Add Slider Before Content Home Page.', 'wpsites' ),
) );
/**
* @author Brad Dalton - WP Sites
* @link http://wp.me/p1lTu0-9Wx
*/
/** Hook Widget Before Content*/
add_action( 'genesis_before_content_sidebar_wrap', 'home_slider_widget_area', 5 );
function wpsites_before_content_home_widget() {
if ( is_home() ) {
echo '<div class="before-content">';
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