Add MAX image size to srcset
-
Hello,
I’m trying to configure the the_post_thumbnail() srcset output so that it doesn’t use the ‘full-size’ image by default (in some cases 8MB). I’ve followed the guide here but doesn’t have the desired result:
https://www.developersq.com/add-custom-srcset-values-for-responsive-images-wordpress/Ideally, if the screen width is larger than 1920px, use image size ‘hero_header_x2’ which I’ve added in my functions.php and NOT the full size image.
add_image_size( ‘hero_header_x2’, 1920, 840, true );Any help would be appreciated!
Harv
- The topic ‘Add MAX image size to srcset’ is closed to new replies.