By default the after entry widget area coded in genesis only displays on single posts.
To enable this widget area on single pages, you’ll need to add support using add_post_type_support in your child themes functions file.
Code Installation #
Add the following PHP code to the end of your child themes functions file.
add_post_type_support( 'page', 'genesis-after-entry-widget-area' );
You could also add the widget area to custom post types like this :
add_post_type_support( 'portfolio', 'genesis-after-entry-widget-area' );
Adds the after entry widget area to single portfolio items for the portfolio custom post type.
Here’s another way to write the code :
add_action( 'init', 'portfolio_after_entry_widget' );
function portfolio_after_entry_widget() {
if ( current_theme_supports( 'genesis-after-entry-widget-area' ) ) {
$type = 'portfolio';
add_post_type_support( $type, 'genesis-after-entry-widget-area' );
}
}
Leave a Reply