-
-
Save About2git/a882b450788074508280 to your computer and use it in GitHub Desktop.
Adding Before Entry widget area in Genesis
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_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>', | |
) ); | |
} |
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
.before-entry { | |
margin-bottom: 2.6rem; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment