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 a freelance WordPress developer and a contributing developer to the Genesis framework. For the past 14 years he has worked with attorneys, publishers, corporations, and non-profits, building custom websites tailored to their needs and goals.

Ready to upgrade your website?

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

Let's Talk