Skip to content

Instantly share code, notes, and snippets.

@srikat
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save srikat/7c50d6d73f95e1d32c2c to your computer and use it in GitHub Desktop.
Save srikat/7c50d6d73f95e1d32c2c to your computer and use it in GitHub Desktop.
Displaying After Entry widget area on Pages in Genesis. http://sridharkatakam.com/display-entry-widget-area-pages-genesis/
<?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' );
<?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>',
) );
}
.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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment