Skip to content

Instantly share code, notes, and snippets.

@srikat
Last active February 24, 2017 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save srikat/7853312 to your computer and use it in GitHub Desktop.
Save srikat/7853312 to your computer and use it in GitHub Desktop.
Showing Full content and Featured image in a CPT archive page regardless of theme settings in Genesis. http://sridharkatakam.com/showing-full-content-featured-image-cpt-archive-page-regardless-theme-settings-genesis/
//* Showing Full content and Featured image in 'testimonial' CPT archive page regardless of theme settings in Genesis
add_action( 'genesis_before_loop', 'sk_full_content_testimonials_archive' );
function sk_full_content_testimonials_archive() {
if ( is_post_type_archive( 'testimonial' ) ) {
add_filter( 'genesis_pre_get_option_content_archive_thumbnail', 'sk_show_post_image' );
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' );
}
}
// 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';
}
// Show Featured image
function sk_show_post_image() {
return '1';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment