Skip to content

Instantly share code, notes, and snippets.

@webmasterninjay
Forked from srikat/gist:7853312
Created February 24, 2017 15:49
Show Gist options
  • Save webmasterninjay/64de09b14e1cf209f15884038ff396be to your computer and use it in GitHub Desktop.
Save webmasterninjay/64de09b14e1cf209f15884038ff396be 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