• sipher1975

    (@sipher1975)


    Hello Anton,

    Is it possible to set a limit on the ‘max w’ parameter via the plugin or through child theme? My site has a width of 1200px, yet images uploaded by editors often are over 3000px. Implementing a cap on image width might significantly reduce the strain of loading high-resolution images, which is crucial given the current incompatibility with the theme we are using.

    I’ve enabled ‘Parse page for images’ and ‘Auto resize images on front-end,’ full-resolution images are loaded in some cases, though not all. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Anton Vanyukov

    (@vanyukov)

    @sipher1975,

    Technically, I could add a filter, but you probably should not do this. How would you handle retina displays?

    Best regards,
    Anton

    Thread Starter sipher1975

    (@sipher1975)

    Hi Anton, Because of theme incompatibility, the majority of images are being downloaded at their full width of 3000px, despite having ‘Parse page for images’ and ‘Auto resize images’ activated. My plan is to limit the maximum width of all images to 1200px until the theme developer can address this issue.

    Is it possible to add this filter through child-theme?

    Plugin Author Anton Vanyukov

    (@vanyukov)

    You can use a filter to set the sizes attribute:

    add_filter( 'wp_calculate_image_sizes', function () {
    	return '1200px';
    } );

    But, please keep in mind that this way you’re setting all images to 1200px, and browsers on retina displays will still request 2x the size, which is probably not what you’re looking for.

    Best regards,
    Anton

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.