Add after-post widget after posts on your site using the Genesis Framework:
// Register after-post widget
genesis_register_sidebar( array(
'id' => 'after-post',
'name' => __( 'After Post', 'sample' ),
'description' => __( 'This is the after post section.', 'sample' ),
) );
If you want to add the widget area with the post content area use this code:
// Hook after-post widget to single posts (inside entry content)
add_action( 'genesis_entry_footer', 'em_entry_footer_widget', );
function em_entry_footer() {
if ( is_single() && is_active_sidebar( 'after-post' ) ) {
echo '<div><div>';
dynamic_sidebar( 'after-post' );
echo '</div></div>';
}
}
If you want to add the widget area just below, and outside of the post content area, use this code:
// Hook after-post widget to single posts (outside entry)
add_action( 'genesis_after_entry', 'em_after_entry_widget', 9 );
function em_after_entry_widget() {
if ( is_single() && is_active_sidebar( 'after-post' ) ) {
echo '<div><div>';
dynamic_sidebar( 'after-post' );
echo '</div></div>';
}
}