Skip to content

Instantly share code, notes, and snippets.

@About2git
Forked from srikat/functions.php
Last active August 29, 2015 14:15
Show Gist options
  • Save About2git/a882b450788074508280 to your computer and use it in GitHub Desktop.
Save About2git/a882b450788074508280 to your computer and use it in GitHub Desktop.
Adding Before Entry widget area in Genesis
//* Register before-entry widget area
genesis_register_sidebar( array(
'id' => 'before-entry',
'name' => __( 'Before Entry', 'your-theme-slug' ),
'description' => __( 'This is the before entry section.', 'your-theme-slug' ),
) );
//* Hooks before-entry widget area to single posts
add_action( 'genesis_entry_content', 'sk_after_entry_widget', 9 );
function sk_after_entry_widget() {
if ( ! is_singular('post' ) )
return;
genesis_widget_area( 'before-entry', array(
'before' => '<div class="before-entry widget-area"><div class="wrap">',
'after' => '</div></div>',
) );
}
.before-entry {
margin-bottom: 2.6rem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment