Skip to content

Instantly share code, notes, and snippets.

@braddalton
Last active December 19, 2015 16:58
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/5987428 to your computer and use it in GitHub Desktop.
Save braddalton/5987428 to your computer and use it in GitHub Desktop.
genesis_register_sidebar( array(
'id' => 'second-category',
'name' => __( 'After Posts Widget', 'wpsites' ),
'description' => __( 'Add Content After Posts in Category.', 'wpsites' ),
) );
/**
* @author Brad Dalton - WP Sites
*/
add_action( 'genesis_after_post_content', 'wpsites_second_category_widget', 9 );
function wpsites_second_category_widget() {
if ( in_category('second-cat) && is_active_sidebar( 'second-category' ) ) {
echo '<div class="after-post">';
dynamic_sidebar( 'second-category' );
echo '</div><!-- end .second-category -->';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment