mirror of
https://github.com/10h30/display-featured-image-genesis.git
synced 2026-06-05 15:08:20 +09:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user