Last active
December 28, 2015 05:18
-
-
Save cdils/7448433 to your computer and use it in GitHub Desktop.
Drop this in functions.php in any Genesis HTML5-enabled theme to add a widget area after single posts.
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
<?php // Get rid of this tag | |
//* Register widget areas | |
genesis_register_sidebar( array( | |
'id' => 'after-entry', | |
'name' => __( 'After Entry', 'theme-prefix' ), | |
'description' => __( 'This is the after entry section.', 'theme-prefix' ), | |
) ); | |
//* Hooks after-entry widget area to single posts | |
add_action( 'genesis_entry_footer', 'my_after_entry_widget' ); | |
function my_after_entry_widget() { | |
if ( ! is_singular( 'post' ) ) | |
return; | |
genesis_widget_area( 'after-entry', array( | |
'before' => '<div class="after-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
/* After Entry | |
--------------------------------------------- */ | |
.after-entry { | |
background-color: #ddd; | |
border-bottom: 1px solid #222; | |
border-top: 2px solid #222; | |
margin-top: 40px; | |
margin-top: 4rem; | |
padding: 30px 0; | |
padding: 3rem 0; | |
} | |
.after-entry p:last-child { | |
margin-bottom: 0; | |
} | |
.after-entry .widget { | |
margin-bottom: 30px; | |
margin-bottom: 3rem; | |
} | |
.after-entry .widget:last-child { | |
margin-bottom: 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment