• If I insert the code <?php the_post_thumbnail(); ?>, why does the src that gets generated result in almost every image size being included? I’m trying to figure out a use case for this function since it generates so much data into the html.

Viewing 1 replies (of 1 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    It’s producing a src set string. Basically, it says to the browser “use this image and, by the way, here are alternative sizes.” Based on the container for the image, the browser decides which is the best image to download. “Data in the HTML” should not be a concern. This produces a better and faster user experience.

    Responsive Images in WordPress 4.4

Viewing 1 replies (of 1 total)

The topic ‘Question about the_post_thumbnail’ is closed to new replies.