0

I am having problem with custom sized srcset. On this page for the DANCE/ARTS/EVENTS section, I selected the Wordpress default "Medium Large" size for the thumbnail images. If I check the codes, I can see the images comes with the "srcset" attribute. Please check the screenshot here.

Then I have created a custom image size with the following code:

add_theme_support( 'post-thumbnails' ); add_image_size( 'medium-cropped', 768, 514, true );

I have regenerated all the images with the Regenerate Thumbnails plugin.

Now I have a custom size "Medium Cropped" to select in Elementor page builder. Please check the 4 thumbnails on this page. If you look at the codes, you will not see the srcset for them. Please check the second screenshot here.

Can anyone suggest me the exact code to add in the functions.php file? I have read many tutorials but unable to find a solution.

1 Answer 1

0

Have a look at this answer: https://wordpress.stackexchange.com/a/243284/64435

If you do not create multiple versions of same proportions no data-src-set will be loaded since you have only one possible target

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.