You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm helping test Jetpack to make sure Photon is fully compatible with 4.4's responsive images and I had a few questions that I was hoping someone could help me with. I'm not a developer, but I can usually figure things out if I have code examples.
I looked at the Twenty Sixteen theme to see how to add custom sizes attributes to post thumbnails and it worked like a charm.
I was wondering if someone could provide me with a code example to add my own srcset attributes to a post thumbnail, using just width and height values. Is that possible? Right now I have a ton of custom image sizes for each post thumbnail, in order to account for 2x and 3x images at all the major breakpoints. Here's what one of them looks like:
That's going to to be rough on my server, so I was wondering if there's a way to just set the srcset values for a post thumbnail via the functions.php file, just like the sizes values. It'd be awesome if Photon can hook into that so that 15+ image sizes won't have to be generated for every post thumbnail. Photon can create those image sizes on the fly.
Hopefully that all makes sense. Any guidance or code examples you can provide would be appreciated. Thank you!
The text was updated successfully, but these errors were encountered:
Thanks @ChrisBegley. What you're aiming for seems like an ideal use of Photon in combination with responsive images. Implementing this idea is something that will probably need to be handled within Photon (related thread), but I'll see what I can come up with in the mean time.
I'm helping test Jetpack to make sure Photon is fully compatible with 4.4's responsive images and I had a few questions that I was hoping someone could help me with. I'm not a developer, but I can usually figure things out if I have code examples.
I looked at the Twenty Sixteen theme to see how to add custom sizes attributes to post thumbnails and it worked like a charm.
I was wondering if someone could provide me with a code example to add my own srcset attributes to a post thumbnail, using just width and height values. Is that possible? Right now I have a ton of custom image sizes for each post thumbnail, in order to account for 2x and 3x images at all the major breakpoints. Here's what one of them looks like:
That's going to to be rough on my server, so I was wondering if there's a way to just set the srcset values for a post thumbnail via the
functions.php
file, just like the sizes values. It'd be awesome if Photon can hook into that so that 15+ image sizes won't have to be generated for every post thumbnail. Photon can create those image sizes on the fly.Hopefully that all makes sense. Any guidance or code examples you can provide would be appreciated. Thank you!
The text was updated successfully, but these errors were encountered: