Skip to content

Instantly share code, notes, and snippets.

@feastdesignco
Created May 18, 2019 11:17
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 feastdesignco/83873370335bb262f76df0e8e147f2d6 to your computer and use it in GitHub Desktop.
Save feastdesignco/83873370335bb262f76df0e8e147f2d6 to your computer and use it in GitHub Desktop.
add-before-entry-widget-area
//* 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_before_entry', '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>',
) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment