如何防止 the_post_thumbnail() 溢出?
我不想设置这个
the_post_thumbnail( array(100,100) );
,因为它输出给我一个固定大小的图像,但我想获得最大图像大小,显然具有正确的宽高比。
I don't want set this
the_post_thumbnail( array(100,100) );
because it output me a fixed size image, but I want obtain max image size, obviously with correct aspect ratio.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信你想要这个:
除了指定尺寸之外,还有多个关键字,例如“thumbnail”,“medium”,“large”和“full”,它们可以让你获得不同的预制尺寸。您还可以使用注册自己的图像尺寸,
然后每次上传图像时它也会裁剪为该尺寸
I believe you want this:
In addition to specifying a size, there are also multiple keywords such as "thumbnail", "medium", "large" and "full" which get you different premade sizes. You can also register your own image size using
Then every time you upload an image it will crop to that size as well