Skip to content

Instantly share code, notes, and snippets.

@braddalton
Created March 19, 2013 16:28
Show Gist options
  • Save braddalton/5197621 to your computer and use it in GitHub Desktop.
Save braddalton/5197621 to your computer and use it in GitHub Desktop.
genesis_register_sidebar( array(
'id' => 'before-content',
'name' => __( 'Custom Widget', 'child' ),
'description' => __( 'This is the before content widget.', 'child' ),
) );
// Hook before-post widget to single page
add_action( 'genesis_before_content_sidebar_wrap', 'custom_before_content', 9 );
function custom_before_content() {
if ( is_single() && is_active_sidebar( 'before-content' ) ) {
echo '<div class="before-content"><div class="wrap">';
dynamic_sidebar( 'before-content' );
echo '</div></div>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment