Only display Featured Image on Archive

<?php
/**
* Only display Featured Image on archive
*
* By default, Genesis will use the first attached image if no featured
* image is provided. This limits the archive to only show featured images.
*
* @param string $output
* @param array $args
* @param object $post
* @return string $output
*/
function be_archive_featured_image_only( $output, $args, $post ) {
if( 'archive' == $args['context'] && !has_post_thumbnail( $post->ID ) )
$output = '';
return $output;
}
add_filter( 'genesis_pre_get_image', 'be_archive_featured_image_only', 10, 3 );
view raw functions.php hosted with ❤ by GitHub

Bill Erickson

Bill Erickson is the co-founder and lead developer at CultivateWP, a WordPress agency focusing on high performance sites for web publishers.

About Me
Ready to upgrade your website?

I build custom WordPress websites that look great and are easy to manage.

Let's Talk