Last active
December 17, 2015 05:08
-
-
Save braddalton/5555087 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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