- This topic has 12 replies, 4 voices, and was last updated 5 months, 1 week ago by George.
September 18, 2019 at 4:11 am #1012394Rafał
Please help! I can’t sleep because of this imperfection of my favorite WP theme…
How do you think about implementing full support of
When we put hi res featured images, which are fine on high density large screens (on single posts), they become serious performance mistakes especially in column layout of blog.
BTW: WP Show Posts does not make any difference on that issue.
By now we may have quite abundant
srcset, but it remains useless along with present scanty
sizesattribute, which does not take into account neither any breakpoints or any theme settings as max width of the main container (without sidebar), or horizontal padding, or column gaps.September 18, 2019 at 9:40 am #1012795TomLead DeveloperLead Developer
By default, GP uses core WP functionality to display featured images, which includes all srcset images.
However, if you’re using the current resizing options in the Customizer, it only includes that one image. We’re working on a solution for that in GPP 1.9.
It would definitely be cool to add some specific sizing options for when posts are in columns. I’ll look into that 🙂September 18, 2019 at 9:55 am #1012811Rafał
Great! Thank you! I’m eagerly waiting…
Good luck!September 18, 2019 at 4:09 pm #1013082TomLead DeveloperLead DeveloperFebruary 10, 2020 at 4:12 pm #1161143George
Hi, sorry for opening up this thread again, has it already been implemented in 1.9?February 11, 2020 at 9:00 am #1162100TomLead DeveloperLead DeveloperMay 16, 2020 at 9:39 am #1287495Dan
Just to add my thoughts to this – I believe (though may be wrong) that the srcset is not the issue with regard to the images being served when the blog is more than one column – it is the sizes attribute. This was the issue identified more eloquently than I am describing in this post – https://generatepress.com/forums/topic/responsive-images/.
This still appears to manifest – for example I have a two column set up where on large screens the thumbnail true width is 390px wide but the sizes attribute states it is 896px wide – sizes=”(max-width: 896px) 100vw, 896px” and hence a far too large srcset image is served.
As you identified in the post I linked to above I suspect this is no easy fix and more to do with how badly WordPress core logic handles the sizes attribute but it would be great to see you work your genius and find a solution to add to what is already an incredible theme.May 16, 2020 at 3:12 pm #1287839TomLead DeveloperLead Developer
It’s kind of an interesting issue. We could do something where srcset/sizes are disabled when columns are active, but that would be a shame for when those attributes are useful.
We could also possibly change the sizes if columns are active, but I’m not sure there’s a way to calculate the ideal widths we’d want.
I’ll assign this to myself and think on it 🙂May 16, 2020 at 11:22 pm #1288148Dan
Agree that the first solution wouldn’t improve the situation.
I guess the logic in the second solution would need to consider factors like container width, content spacing and number of columns to give a relatively accurate number at larger screen sizes….but am getting way beyond my capability so will leave it your more than capable hands.
Thank you as ever for such incredible support.May 17, 2020 at 9:43 am #1288861TomLead DeveloperLead DeveloperMay 17, 2020 at 10:08 am #1288898George
It might just be possible to do some math on the PHP side of things. Even if the number was approximate (container width / number of columns), it would be a better result than it is now.May 17, 2020 at 3:41 pm #1289263George
Aha, ok, good to know!
- You must be logged in to reply to this topic.