admin管理员组文章数量:1302277
I've read a bunch of tutorials on how to create filters for srcsets
and srcset
sizes, but they all appear to be applied globally, with a fixed width or set of widths for sizes.
The trouble is, I pull in content from posts and pages in template parts throughout my sites, and these typically display the featured image in a much smaller context.
So although it's properly using Wordpress's responsive images, the width by default is set to 100vw
, so even if it's never displayed at larger than 1/3rd of the screen width, it'll still be loading a srcset
intended for full-width screens.
How can I create individual filters (or any other appropriate method), for each template part so I can control more precisely the sizes in my srcsets
?
本文标签: imagesHow to create 39Local39 filters for WordPress srcset sizes in template parts
版权声明:本文标题:images - How to create 'Local' filters for WordPress srcset sizes in template parts? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741704579a2393481.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论