I have a weird issue going on in WordPress at the moment. Some images does not return any image sizes, and when using
wp_get_attachment_image_srcset it simply returns false. I have no idea why this is happening.
What I have tried, however, to no avail:
- Disabling my theme and all plugins
- Regenerating thumbnails for the specific attachment
- Verifying that the physical images are actually on disk - they are, and I can query them fine directly in the URL-address-bar.
- Trying to regenerate missing thumbnails as recommended here: Regenerate missing _wp_attachment_metadata (despite the thumbnails are not really missing, as they are on disk)
So to be precise:
falsefor some attachments, but not all
wp_get_attachment_metadatareturns metadata, however, the
sizesarray is empty
It seems as though a lot of people have had problems with this, however, no real solution, and many have made workarounds:
- wp_get_attachment_image_src always returns false
- image srcset returns false
- Regenerate missing _wp_attachment_metadata