• Hi,

    When using Post Thumbnail Editor, it seems to me that the function wp_get_attachment_image() doesn’t include the generated thumbnail of that specific size anymore. Am I the only one with this issue and might I be doing something wrong? This is the code I use to generate the image:

    <img src="<?php echo get_the_post_thumbnail_url('', 'thumbnail'); ?>" srcset="<?php echo wp_get_attachment_image_srcset( get_post_thumbnail_id(), ''); ?>" sizes="(max-width: 478px) 447px, (min-width: 479px) and (max-width: 767px) 353px, (max-width: 991px) 220px, (min-width: 992px) 204px" alt="">

Viewing 3 replies - 1 through 3 (of 3 total)
  • i’ve just noticed the same issue – did you ever find a fix?

    In my case, I see the result of the crops of my custom thumbnails sizes while in the Post Thumbnail Editor, however when I generate and serve the results of wp_get_attachment_image_srcset, it points the older versions of the images before the custom cropping.

    So clearly the Post Thumbnail Editor is making the new thumbnails, and they exist on the server, but so do the old ones, as they are never deleted or replaced with the new crop.

    This would account for the ballooning image count I’m seeing.

    I have the RICG Responsive Images plugin installed if that matters, I don’t recall if this has been folded into core completely.

    Thread Starter ProxxiM

    (@proxxim)

    Hi orionrush, I couldn’t get this fixed and am using another way to retrieve the pictures and am putting them in a <picture> element now. So I’m not using the wp_get_attachment_image_srcset function anymore.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wp_get_attachment_image_srcset not working’ is closed to new replies.