- This topic has 6 replies, 2 voices, and was last updated 3 years, 2 months ago by
Rauno.
-
AuthorPosts
-
November 15, 2019 at 10:37 am #1064286
Rauno
Hi! A GP Pro member here with a bug report for WP Show Posts. I hope it’s ok.
I was over the moon a month ago when I finally figured out how to use smaller image files with WP Show Posts. I used the following solution provided by Tom: https://generatepress.com/forums/topic/image-sizing-not-working-with-amazon-web-services-and-wp-offload-media/.
The code I use is:
add_filter( 'wpsp_default_image_size', function() { return 'medium'; } );
Now I noticed that the filter works only for desktop. When the page is loaded on mobile or tablet, full sized images are loaded.
I noticed this first in Firefox Inspector and can see the same if I run webpagetest.org with both desktop and mobile emulation.
Thanks,
-Rauno.November 15, 2019 at 7:36 pm #1064528Tom
Lead DeveloperLead DeveloperHi there,
Is there a WPSP list on the page you linked us to? I’m not seeing it.
Let me know π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentNovember 18, 2019 at 11:37 am #1066782Rauno
Hi Tom,
There are two WPSP lists on the page: One between tutorial steps 4 and 5. And another one between steps 8 and 9.
Thanks!November 18, 2019 at 3:36 pm #1066929Tom
Lead DeveloperLead DeveloperAh, well the code is working, but
srcset
is in use, which provides different image sizes for different screen sizes. It’s possible to remove it if you’d like?Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentNovember 19, 2019 at 12:41 pm #1067752Rauno
Thanks Tom. I had to spend a couple of hours reading about srcset and sizes attributes and related WordPress functionality.
I ended up disabling the WordPress default srcset attributes. I used these snippets: https://perishablepress.com/disable-wordpress-responsive-images/. Everything seems to be working fine and loaded images have much smaller file size now.
In the long run, though, I would be more comfortable if WP Show Posts would specify “optimal” sizes attribute. Do you think that would be possible?
Thanks!
-Rauno.November 19, 2019 at 4:34 pm #1067896Tom
Lead DeveloperLead DeveloperThe entire image resizing option in WPSP (and GP) needs to be re-done. It’s high on my priorities π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentNovember 20, 2019 at 12:20 pm #1069023Rauno
π Thanks!
-
AuthorPosts
- You must be logged in to reply to this topic.