-
-
Save jpmarchand/aaa3bb4532156b256630 to your computer and use it in GitHub Desktop.
Register and display a new widget area in Genesis. Source: https://my.studiopress.com/documentation/tutorials/widget-areas/register-a-widget-area/
This file contains 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 | |
//* 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' ), | |
) ); | |
//* Hook After Post widget area after post content | |
add_action( 'genesis_entry_footer', 'customprefix_after_post_widget' ); | |
function customprefix_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