Skip to content

Instantly share code, notes, and snippets.

@braddalton
Last active December 17, 2015 05:08
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/5555087 to your computer and use it in GitHub Desktop.
Save braddalton/5555087 to your computer and use it in GitHub Desktop.
genesis_register_sidebar( array(
'id' => 'after-post',
'name' => __( '1st After Post', 'child' ),
'description' => __( 'This is the first after post widget.', 'child' ),
) );
genesis_register_sidebar( array(
'id' => 'after-post-second',
'name' => __( 'Second After Post', 'child' ),
'description' => __( 'This is the second after post widget.', 'child' ),
) );
add_action( 'genesis_after_post', 'wpsites_after_post', 5 );
function wpsites_after_post() {
if ( is_single() && is_active_sidebar( 'after-post' ) ) {
echo '<div class="after-post"><div class="wrap">';
dynamic_sidebar( 'after-post' );
echo '</div></div>';
}
}
/**
* @author Brad Dalton
* @link http://wpsites.net/web-design/add-multiple-widgets-using-the-same-hook-position/
*/
add_action( 'genesis_after_post', 'wpsites_after_post_second', 6 );
function wpsites_after_post_second() {
if ( is_single() && is_active_sidebar( 'after-post-second' ) ) {
echo '<div class="after-post-second"><div class="wrap">';
dynamic_sidebar( 'after-post-second' );
echo '</div></div>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment