Skip to content

Instantly share code, notes, and snippets.

@braddalton
Last active December 15, 2015 02:48
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/5189432 to your computer and use it in GitHub Desktop.
Save braddalton/5189432 to your computer and use it in GitHub Desktop.
// Register custom widget
genesis_register_sidebar( array(
'id' => 'after-content',
'name' => __( 'After Post Content', 'child' ),
'description' => __( 'This widget executes after your single posts content.', 'child' ),
) );
// Hook widget after single post content only
add_action( 'genesis_after_post_content', 'widget_after_content', 9 );
function widget_after_content() {
if ( is_single() && is_active_sidebar( 'after-content' ) ) {
echo '<div class="after-content"><div class="wrap">';
dynamic_sidebar( 'after-content' );
echo '</div></div>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment