Automatically generate multiple image sizes for element
I have a similar need in some projects of mine and solved by getting the image ID from it’s URL and then writing the markup with wp_get_attachment_image as it will return a markup with srcset attribute. To get the image ID, I am using Gustavo Bordoni’s helpers as it follows and shown in here. function … Read more