[theme-reviewers] Why the bias?

Otto otto at ottodestruct.com
Tue Feb 15 04:41:48 UTC 2011


On Mon, Feb 14, 2011 at 9:32 PM, Philip M. Hofer (Frumph)
<philip at frumph.net> wrote:
> btw, content width should be the amount of space is available width wise
> that a post content has to show, it's mainly used for display youtube etc
> videos in the content area

Basically, the $content_width needs to be set to the maximum width of
the content area, where the post will be most commonly displayed. This
allows the image inserter to resize images to fit within that space.

Because of the way the media system works, this resizing happens at
the time the image code is inserted into the editor (and only for
"large" image sizes). Therefore, the $content_width should be set to
the most common width seen in the theme, not necessarily the maximum
possible width in the entire theme. Especially if you have custom code
for image attachment pages, then this is the best way. With the use of
add_image_size to create a custom size, you can make an image
displayed on its own attachment page (image.php template) display at
that specific size, allowing you to bypass content width.

An example of this would be where the image.php page shows the full
sized image and gets rid of the sidebar, for example. There, the
content width is larger than on the rest of the site. but you still
want the $content_width to be set to what the rest of the site would
be, and you would just use a custom size on that template, to fit the
image at the size you want it to be. The $content_width only apples to
'large' sized images.

-Otto


More information about the theme-reviewers mailing list