Plugin Support
Alvind
(@alvindcaesar)
Hi there,
I believe WordPress handles this automatically by choosing the appropriate image sizes based on your settings in Settings > Media.
Could you check your settings to see if you’ve specified the width and height for the thumbnail and medium sizes?
Hi Alvind,
The thumbnail and medium sizes are set (150×0 and 300×0). Both are generated by WP (checked the upload folder).
Plugin Support
ying
(@yingscarlett)
Mobile phone screens with high resolution usually requires 2x its width to load the image.
For example, if the phone screen is 350px, then it requires at least 700px width images.
If you want mobile to load lower resolution images, you need to add a rewrite rule to load 150px width image on mobile, so it will actually use 300px images on mobile.
function db_modify_srcset_sizes($sizes, $size) {
$sizes = '(max-width: 440px) 150px, (min-width: 441px) 768px, (min-width: 769px) 1024px, 100vw';
return $sizes;
}
add_filter('wp_calculate_image_sizes', 'db_modify_srcset_sizes', 10 , 2)
I think I’ll let this one go for now. Thank you for the help though.