0

I hope it's a fitting question to be asked here. My website loads the images and then resizing them. So what happens is the image is loaded full sized and then reduced. I have lots of images already and it won't be relevant to re-upload all the images.

Is there a setting, code or plugin which will allow me to reduce the images according to the needs before it loads?

Now I am getting page size of 68MB(!).

Thanks.

0

Responsive images are in WordPress core since 4.4

https://make.wordpress.org/core/2015/11/10/responsive-images-in-wordpress-4-4/

srcset and sizes are used to accomplish this.

If your theme doesn't implement these properly you will have to modify theme files.

<?php
// Specifying width of 400 (px) and height of 200 (px).
$srcset = wp_get_attachment_image_srcset( get_custom_header()->attachment_id, array( 400, 200 ) );
?>
<img src="<?php header_image(); ?>" srcset="<?php echo esc_attr( $srcset ); ?>">

https://developer.wordpress.org/reference/functions/wp_get_attachment_image_srcset/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.