-
-
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* 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