Last active
August 11, 2016 15:10
-
-
Save studiopress/5635539 to your computer and use it in GitHub Desktop.
Genesis after post widget.
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 | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* Register after post widget area | |
genesis_register_sidebar( array( | |
'id' => 'after-post', | |
'name' => __( 'After Post', 'themename' ), | |
'description' => __( 'This is a widget area that can be placed after the post', 'themename' ), | |
) ); |
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 | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* Hook widget area after post content | |
genesis_widget_area( 'after-post', array( | |
'before' => '<div class="after-post widget-area">', | |
'after' => '</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
<?php | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* Hook after post widget area after post content | |
add_action( 'genesis_after_post_content', 'sp_after_post_widget' ); | |
function sp_after_post_widget() { | |
if ( is_singular( 'post' ) ) | |
genesis_widget_area( 'after-post', array( | |
'before' => '<div class="after-post widget-area">', | |
'after' => '</div>', | |
) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The code in the register-widget-area-2.php needs close parens and semicolon.