Skip to content

Instantly share code, notes, and snippets.

@srikat
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srikat/bc3faeccfa9cd85dafeb to your computer and use it in GitHub Desktop.
Save srikat/bc3faeccfa9cd85dafeb to your computer and use it in GitHub Desktop.
How to display one sticky Post in Home Bottom section in Enterprise Pro. https://sridharkatakam.com/how-to-display-one-sticky-post-in-home-bottom-section-of-enterprise-pro/
function enterprise_home_bottom_widgets() {
genesis_widget_area( 'home-bottom', array(
'before' => '<div class="home-bottom widget-area">',
'after' => '</div>',
) );
}
function enterprise_home_bottom_widgets() {
// genesis_widget_area( 'home-bottom', array(
// 'before' => '<div class="home-bottom widget-area">',
// 'after' => '</div>',
// ) );
// Display just the first sticky post, if none return the last post published
$args = (array(
'posts_per_page' => 1,
'post__in' => get_option( 'sticky_posts' ),
'ignore_sticky_posts' => 1,
));
genesis_custom_loop( $args );
}
// Remove Archive Pagination
remove_action( 'genesis_after_endwhile', 'genesis_posts_nav' );
add_filter( 'genesis_pre_get_option_content_archive', 'sk_do_full_content' );
add_filter( 'genesis_pre_get_option_content_archive_limit', 'sk_no_content_limit' );
add_filter( 'genesis_pre_get_option_content_archive_thumbnail', 'sk_show_post_image' );
// Set the content archives to full
function sk_do_full_content() {
return 'full';
}
// Make sure the content limit isn't set
function sk_no_content_limit() {
return '0';
}
// Control the visibility of Featured image
// 1 to show, 0 to hide
function sk_show_post_image() {
return '0';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment