Site logo

Archived topic

Serve Scaled Images

10 replies · Started by Angel on February 9, 2021

Viewing posts 1–11 of 11

Hey,

I have the issue that Wordpress don't serve scaled images properly.
No matter what sizes I set in media settings, on desktop it always serves the 1536x1536 version that they introduced in version 5.3 and on mobile it serves the 1024x1024 sized image.
I tried changing the large size in media setting to one lower than 1024p but then wordpress serves the 1536p version instead.
How can I force it to serve smaller images?

Thanks

Hi there,

can you disable the Litespeed Lazy Loaded as it looks like this is changing the IMG HTML src-set. Once thats disabled i can take a look.

Disabled, thanks!

The image size is set to Large, can you change the size of the images to medium-large - this will set the max size to 768px. ( your max image size is just over 700px ).

How do I do that, thanks!

Are you using the Classic Editor or the Block Editor ?

Oh, I got you!
I thought that there was some site-wide setting.
Thanks

I cannot find medium large in the image setting in the classic editor though.
Thanks

Try adding this PHP Snippet to get the Medium Large to display:

add_filter( 'image_size_names_choose', 'refresh_custom_sizes' );
function refresh_custom_sizes( $sizes ) {
   return array_merge( $sizes, array(
      'medium_large' => __( 'Medium Large' ),
   ) );
}

How to add PHP: https://docs.generatepress.com/article/adding-php/

Thanks!

You're welcome

This archived topic is closed to new replies.