I'm not aware of any consensus *best* practice for dynamic content-width; however, I use a method in Oenology that works, and has thus far been robust, for setting $content_width dynamically according to the selected layout (full, one-column, two-column, three-column, etc.). Here's the function:<div>
<a href="https://github.com/chipbennett/oenology/blob/master/functions/theme-setup.php#L33">https://github.com/chipbennett/oenology/blob/master/functions/theme-setup.php#L33</a></div><div><br></div><div>Note that I hook the function both into wp_head with a priority of 0, and also into admin_head (so that it applies to the post editor).</div>
<div><br></div><div>(If anyone has any ideas for improving the implementation, or has any ideas for a better practice altogether, I'll be happy to modify.)</div><div><br></div><div>Chip<br><br><div class="gmail_quote">
On Wed, Jan 25, 2012 at 4:41 PM, Kirk Wight <span dir="ltr"><<a href="mailto:kwight@kwight.ca">kwight@kwight.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>It seems $content_width has to be in pixels, so unless it's set very small, it's conceivable that the embed test in the Theme Unit Test will overflow the content area at some point.</div><div><br></div><div>What is the best method for setting $content_width in a variable-width theme?<div>
<br></div></div>
<br>_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
<br></blockquote></div><br></div>