How to Stop Genesis from using first attached post image if no featured image
Archive pages are showing image even if no featured image is displayed. I only want the image shown if a featured image is assigned. If no featured image, then no image display on archive / category page.
Use the following snippet of code :
add_filter( 'genesis_get_image_default_args', 'vengala_stop_auto_featured_image' );
/**
* Stop Genesis archives from using first attached image as fallback when no featured image is set.
*
* @param array $args Default image arguments.
*
* @return array Amended default image arguments.
*/
function vengala_stop_auto_featured_image( $args ) {
$args['fallback'] = false;
return $args;
}
Leave a Reply
You must be logged in to post a comment.