[Support request] Image sizes displayed by Search.php – data-srcset and data-sizes

Home Forums Support Image sizes displayed by Search.php – data-srcset and data-sizes

  • This topic has 1 reply, 2 voices, and was last updated 1 month ago by Tom.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1356956
    Simon

    Hi Tom, David, Leo

    I have created a grid layout for the archive, category archive and search pages on this website, using CSS. The image sizes are usually selected correctly from the srcset. – However, on the search results pages the full size 1280px images are selected, even though the page should deliver the small 267px or 535px thumbnails.

    Inspecting the code shows the data-sizes instruction to be the problem:
    data-sizes="(max-width: 1206px) 100vw, 1206px"

    I can’t work out where this is coming from. By contrast, the main archive shows:
    data-sizes="(max-width: 201px) 100vw, 201px"
    for portrait photos, and
    data-sizes="(max-width: 268px) 100vw, 268px"
    for landscape photos.

    Can you see where this 1206px instruction on the search results page is coming from? and/or how I change it?

    (In case it’s relevant – I created a copy of search.php in the child theme, in order to place the search results within a <div>, as a means to use CSS to present those results within the same grid layout as the main archive, while leaving the heading outside the grid. I have mirrored the same container sizes in the archive and search page (only with a slight adjustment for screens over 1000px) – and those containers work correctly.)

    Hope you can see the problem. Thank you!

    #1357264
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    I’m seeing max-width: 960px right now.

    I’m not sure what would cause such a big difference – WordPress does all of that calculation.

    Does it still happen with your other plugins deactivated?

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.