How to display After Entry widget area on Pages in Genesis

Genesis has a useful ‘After Entry’ widget area that appears below single Posts when enabled by adding

1 2 3 4 5
<?php
//* Do NOT include the opening php tag
 
//* Activate After Entry widget area and display it on single Posts
add_theme_support( 'genesis-after-entry-widget-area' );
view raw functions.php hosted with ❤ by GitHub

in child theme’s functions.php.

Note: Some child themes like News Pro has code to register this widget area and to display it. In such cases you should not add the above code.

We can drag any widget into this widget area at Appearance > Widgets.

Screen Shot 2014-10-21 at 11.29.02 am

Screenshot in Genesis Sample:

Screen Shot 2014-10-21 at 11.30.49 am

Let’s make it look better by adding

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
.after-entry {
background: #333;
color: #fff;
padding: 40px;
margin-bottom: 40px;
}
.after-entry h4.widget-title {
color: #fff;
}
 
.after-entry .widget {
margin-bottom: 40px;
}
.after-entry .widget:last-child {
margin-bottom: 0;
}
view raw style.css hosted with ❤ by GitHub

in style.css.

Screen Shot 2014-10-21 at 11.32.40 am

Want the same to appear after the content in static Pages as well?

Just add the following in functions.php:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
<?php
//* Do NOT include the opening php tag
 
add_action( 'genesis_after_entry', 'sk_after_entry_widget_area' );
/**
* Display after-entry widget area on the genesis_after_entry action hook.
*
* Scope: Static Pages
*
* @uses genesis_widget_area() Output widget area.
*/
function sk_after_entry_widget_area() {
 
if ( ! is_singular( 'page' ) || ! current_theme_supports( 'genesis-after-entry-widget-area' ) ) {
return;
}
 
genesis_widget_area( 'after-entry', array(
'before' => '<div class="after-entry widget-area">',
'after' => '</div>',
) );
 
}
view raw gistfile1.php hosted with ❤ by GitHub

Source: wp-content/themes/genesis/lib/structure/post.php.