Support

Account

Home Forums Front-end Issues Cannot get srcset to output anything Reply To: Cannot get srcset to output anything

  • I went through all the sizes and made sure they were exactly 3:2 to the pixel.
    I was adding new images after changing these, but still had to run regenerate thumbnails to get this to work. The srcset now appears, but the code output is:

    <img width="1320" height="880" src="https://project.test/wp-content/uploads/2019/03/istockphoto-452178671-2048x2048.jpg" class="attachment-project-full size-project-full" alt="test alt" srcset="https://project.test/wp-content/uploads/2019/03/istockphoto-452178671-2048x2048.jpg 1320w, https://project.test/wp-content/uploads/2019/03/istockphoto-452178671-2048x2048-732x488.jpg 732w, https://project.test/wp-content/uploads/2019/03/istockphoto-452178671-2048x2048-768x512.jpg 768w, https://project.test/wp-content/uploads/2019/03/istockphoto-452178671-2048x2048-540x360.jpg 540w, https://project.test/wp-content/uploads/2019/03/istockphoto-452178671-2048x2048-1500x1000.jpg 1500w" sizes="(max-width: 1320px) 100vw, 1320px" />

    Should the sizes attr not output all of the available sizes, or should this be specified like an array?

    Currently the same full size image is being served everywhere.