fix archive thumbnails

If a post has an image attached (uploaded to that post), Genesis uses
that for the archive, which results in a duplicate image. This now
outputs a term/CPT image only if the post has no attached image.
This commit is contained in:
Robin Cornett
2015-04-27 11:26:29 -04:00
parent dca2a33929
commit 4da66b80ee
+10 -1
View File
@@ -153,7 +153,16 @@ function display_featured_image_genesis_add_archive_thumbnails() {
return;
}
if ( has_post_thumbnail() ) {
$args = array(
'order' => 'ASC',
'orderby' => 'menu_order',
'post_mime_type' => 'image',
'post_parent' => $post_id ? $post_id : get_the_ID(),
'post_type' => 'attachment',
);
$attached_images = get_children( $args );
if ( has_post_thumbnail() || $attached_images ) {
return;
}