1

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.

6
  • Does the image load outside of WP? – vancoder May 7 at 19:55
  • Check the browser console for errors. – Robert Went May 7 at 23:27
  • @vancoder Yes, the image loads normally when accessed directly. – Natasha May 8 at 5:20
  • @RobertWent There are no errors in the console. – Natasha May 8 at 5:20
  • 1
    Can you add a link to the site so we can take a look? Sounds like a css issue. – Robert Went May 8 at 19:35
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.