Skip Navigation

[Resolved] Image srcset in toolset blocks

This thread is resolved. Here is a description of the problem and solution.

Problem:
Image srcset in toolset blocks for custom image with custom size

Solution:
The srcset will be available when a WordPress registered size used to display the image, if you are using the custom image size, it will not used..

Having said that, srcset will not be applied when you are using the custom image size.

Relevant Documentation:

This support ticket is created 3 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by lukaszS-3 3 years, 10 months ago.

Assisted by: Minesh.

Author
Posts
#2000537

Hi,

I'm new to Toolset but I haven't been able to find an answer in the documentation.

Currently when I'm adding featured image in block editor I can pick up a size with the ability to choose a custom size. However, when I look into the code - the srcset isn't generated, only the src.

If I add custom sizes via add_image_size() function and those sizes will have the same proportions - will Toolset generate srcset for image block automatically?

Can I work with images in Toolset blocks and have proper srcset generated?

#2000605

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

The srcset will be available when a WordPress registered size used to display the image, if you are using the custom image size, it will not used..

Having said that, srcset will not be applied when you are using the custom image size. We do have a internal ticket where we are on initial discussion about this feature to add or not but I do not promise anything on it. As it may get rejected as well.

If the feature is approved, you will see it will be available in near future but there is no ETA on it.

#2000791

Ok, cool. I'll create custom sizes in functions.php of my theme then. Thanks!