Created
May 18, 2019 11:17
-
-
Save feastdesignco/83873370335bb262f76df0e8e147f2d6 to your computer and use it in GitHub Desktop.
add-before-entry-widget-area
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* 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