[theme-reviewers] $content_width and after_theme_setup: d'oh!

Chip Bennett chip at chipbennett.net
Sun Jan 16 01:52:26 UTC 2011


Yeah... 3 1/2, and 2. So if you ever hear me say that family is taking up
all my time, I really do mean it. :)

Chip

On Sat, Jan 15, 2011 at 7:50 PM, Emil Uzelac <emil at themeid.com> wrote:

> I understood what you meant before :) two girls? Nice! we have one and
> sometimes she's like two.
>
>
> *Emil Uzelac* | ThemeID | T: 224-444-0006 | Twitter: @EmilUzelac<http://twitter.com/emiluzelac>| E:
> emil at themeid.com | http://themeid.com
> *Make everything as simple as possible, but not simpler.* - Albert
> Einstein
>
>
>
> On Sat, Jan 15, 2011 at 7:46 PM, Chip Bennett <chip at chipbennett.net>wrote:
>
>> And yes, I meant "after_setup_theme".
>>
>> I shouldn't try to compose emails while simultaneously giving the girls
>> baths...
>>
>> Chip
>>
>>
>> On Sat, Jan 15, 2011 at 7:05 PM, Otto <otto at ottodestruct.com> wrote:
>>
>>> Sorry, I meant "after_setup_theme". I always get that wrong.
>>>
>>> -Otto
>>>
>>>
>>>
>>> On Sat, Jan 15, 2011 at 8:04 PM, Otto <otto at ottodestruct.com> wrote:
>>> > Actually, I believe it only needs to be set globally. The easy way to
>>> > do this is to set it outside that hook, and that's what twentyten
>>> > does, but this would be equally valid:
>>> >
>>> > add_action('after_theme_setup','theme_setup');
>>> > function theme_setup() {
>>> >  global $content_width;
>>> >  if ( ! isset( $content_width ) )
>>> >    $content_width=640;
>>> > }
>>> >
>>> > Also equally valid would be to set $_GLOBALS['content_width'] = 640;
>>> > or similar. Same thing, really.
>>> >
>>> > However, for theme compatibility (and to allow child themes to
>>> > override it) the "if ( ! isset( $content_width ) )" should be used as
>>> > well.
>>> >
>>> > -Otto
>>> >
>>> >
>>> > On Sat, Jan 15, 2011 at 7:54 PM, Chip Bennett <chip at chipbennett.net>
>>> wrote:
>>> >> So, I just realized something today regarding setting $content_width:
>>> it
>>> >> must be set *before* the after_theme_setup hook.
>>> >> Just a mental note to myself, to check functions.php to ensure that
>>> the call
>>> >> to set $content_width isn't inside of a theme setup function that gets
>>> >> called on after_theme_setup. I thought I'd share that with everyone,
>>> just in
>>> >> case I'm not the only one who needed that clarification. :)
>>> >> Chip
>>> >> _______________________________________________
>>> >> theme-reviewers mailing list
>>> >> theme-reviewers at lists.wordpress.org
>>> >> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>>> >>
>>> >>
>>> >
>>> _______________________________________________
>>> theme-reviewers mailing list
>>> theme-reviewers at lists.wordpress.org
>>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>>>
>>
>>
>> _______________________________________________
>> theme-reviewers mailing list
>> theme-reviewers at lists.wordpress.org
>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>>
>>
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20110115/6f8990ab/attachment.htm>


More information about the theme-reviewers mailing list