Skip to content

Instantly share code, notes, and snippets.

@braddalton
Last active December 19, 2015 09: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/5933565 to your computer and use it in GitHub Desktop.
Save braddalton/5933565 to your computer and use it in GitHub Desktop.
genesis_register_sidebar( array(
'id' => 'custom-widget',
'name' => __( 'Custom Home Widget', 'wpsites' ),
'description' => __( 'Displays Content After Header Home Page Only', 'wpsites' ),
) );
/**
* @author Brad Dalton - WP Sites
* @example http://wp.me/p1lTu0-9Jr
*/
add_action( 'genesis_after_header', 'wpsites_custom_widget', 9 );
function wpsites_custom_widget() {
if ( is_home() ) {
echo '<div class="custom-widget">';
dynamic_sidebar( 'custom-widget' );
echo '</div><!-- end .custom-widget -->';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment