how to get image srcset

Hi,

thanks for the effort of creating this plugin. How do I get responsive image?

I tried with and <img src=”{Field image_url}” but both link to original image. Any advice?

Thanks

1 Like

Hello, thank you for the question.

At the moment, getting image srcset is not supported yet - but it’s definitely on the roadmap to be implemented soon.

The current plan is to provide two additional fields, image_srcset and image_sizes, based on this article in the WordPress documentation: https://developer.wordpress.org/apis/handbook/responsive-images/#customizing-responsive-image-markup

When it’s ready, I’ll make sure to add a comment on this discussion thread to let you know.

2 Likes

Hi @gingibash - Just wanted to write you an update, that responsive image fields have been added.

For the featured image of a post, the fields are called image_srcset and image_sizes. They’re used like this:

<img src="{Field image_url}" srcset="{Field image_srcset}" sizes="{Field image_sizes}">

When inside an attachment loop, the fields are called srcset and sizes.

2 Likes