Pregunta

A client running a custom theme recently updated their WordPress version from 5.2.7 to 5.7.1. After this update, featured images in blog archives are no longer loading.

The theme has been updated to be compatible with the latest WordPress release and is throwing no errors.

To be clear, the markup is there -- we have the img tag loading with all necessary data (class, src, srcset, etc.). It's just that the image itself won't load, as though it's missing from the server. I've tried removing the featured image, setting a new featured image, and uploading a new featured image. I've even tried such a simple thing as clearing my cache, but nothing gets the image to load.

I know this will simply be outdated code, but I'm struggling to locate the precise issue. Featured images are enabled with add_theme_support( 'post-thumbnails' ); and the image is retrieved with echo get_the_post_thumbnail( $post->ID, 'full' );.

I've tried regenerating thumbnails with Regenerate Thumbnails in case of any errors, with no success.

Any insight as to how this can be corrected would be much appreciated.

¿Fue útil?

Solución

As suggested by @RobertWent, it was a simple matter of a CSS issue.

A rogue display: flex; on the image container was the troublemaker, and once removed, the issue was resolved.

Licenciado bajo: CC-BY-SA con atribución
scroll top