admin管理员组文章数量:1130349
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.
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.
Share Improve this question asked Nov 1, 2018 at 7:56 OmerOmer 1491 gold badge4 silver badges14 bronze badges1 Answer
Reset to default 0Responsive images are in WordPress core since 4.4
https://make.wordpress/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/reference/functions/wp_get_attachment_image_srcset/
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.
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.
Share Improve this question asked Nov 1, 2018 at 7:56 OmerOmer 1491 gold badge4 silver badges14 bronze badges1 Answer
Reset to default 0Responsive images are in WordPress core since 4.4
https://make.wordpress/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/reference/functions/wp_get_attachment_image_srcset/
本文标签: Page size too big due to images
版权声明:本文标题:Page size too big due to images 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749215302a2334057.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论