Skip to content

Instantly share code, notes, and snippets.

@braddalton
Last active December 20, 2015 01: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/6049293 to your computer and use it in GitHub Desktop.
Save braddalton/6049293 to your computer and use it in GitHub Desktop.
genesis_register_sidebar( array(
'id' => 'home-widget',
'name' => __( 'Home Widget', 'wpsitesdotnet' ),
'description' => __( 'Full width content home page widget.', 'wpsitesdotnet' )
) );
/**
* @author Brad Dalton - WP Sites
* @example http://wp.me/p1lTu0-9Jr
*/
add_action( 'genesis_after_content_sidebar_wrap', 'wpsites_home_page_widget', 5 );
function wpsites_home_page_widget() {
if ( is_home() && is_active_sidebar( 'home-widget' ) ) {
echo '<div class="widget">';
dynamic_sidebar( 'home-widget' );
echo '</div><!-- end .home-widget -->';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment