admin管理员组文章数量:1334887
In the requirements of Envato I saw that they require a $content_width
to be set. I searched for it on the internet but can't really understand why?
I don't use it and the theme is responsive.
If I only declare the $content_width
and never use it, what value should I give it?
In the requirements of Envato I saw that they require a $content_width
to be set. I searched for it on the internet but can't really understand why?
I don't use it and the theme is responsive.
If I only declare the $content_width
and never use it, what value should I give it?
1 Answer
Reset to default 3$content_width
is used to set the default width of embeds, for situations when an element needed to specify a width. This is how WP knew the width of the main content area.
However, this was back before the push for responsive design, and modern CSS with fluid embeds and responsive breakpoints. So it isn't needed much but it can still result in odd embeds if you set a bad value. Content width sometimes gets used in other edge cases too, but that was the main use case and its reason for being.
So I suggest:
- Figure out the content width on the most common desktop resolution, and use it to set
$content_width
infunctions.php
- Then, apply CSS to adjust embeds responsively/fluidly as you would normally do
本文标签: variablesWhat is the use of contentwidth
版权声明:本文标题:variables - What is the use of $content_width? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742380467a2463988.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论