Strange img srcset behaviour

After some further digging, I discovered that the max srcset size in WordPress 4.4 is set to 1600px wide by default. You can fix this by adding the following filter:

add_filter( 'max_srcset_image_width', 'max_srcset_image_width', 10 , 2 );
function max_srcset_image_width() {
    return 2048;
}

The helper function and this information is thanks to: http://aaronrutley.com/responsive-images-in-wordpress-with-acf

Leave a Comment