Below is the code to register and display a new custom widget area in Genesis.
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>', | |
) ); | |
} | |
} |