<?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 ); |
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