[theme-reviewers] wp_enqueue_style

Chip Bennett chip at chipbennett.net
Fri Jun 3 11:00:51 UTC 2011


The current "default" recommendation for the comment-reply.js script is to
dump wp_enqueue_script() in the header.php template file. It works, but is
less-than-ideal.

To clarify:

Front-end styles: use the 'wp_print_styles' hook
Front-end scripts: use the 'wp_enqueue_scripts' hook

And: ah yes, GoogleFonts. That's certainly valid. :) But, you'll want to
advise the developer to hook the wp_enqueue_style() *function* into the
'wp_print_styles' *hook*. (You *can* hook into 'wp_head', but
'wp_print_styles' is more accurate.)

Chip

On Fri, Jun 3, 2011 at 5:48 AM, Vicky Arulsingam <vicky.arulsingam at gmail.com
> wrote:

> On Fri, Jun 3, 2011 at 6:44 PM, Chip Bennett <chip at chipbennett.net> wrote:
>
>> I see a few issues:
>>
>> 1) Styles should be enqueued and *hooked* in; front-end styles should be
>> hooked into 'wp_print_styles'.
>>
>>
> I've seen a number of themes that use wp_enqueue_style() /
> wp_enqueue_script within the header.php.  I'll be sure to distinguish
> between wp_print_style and wp_enqueue_style in future reviews.
>
>
>
>> 2) 'MyStyle' is too generic of a name. This is another instance where
>> something should be theme-slug prefixed.
>>
>> 3) Is the URL an external resource? I can't readily imagine a viable
>> reason that a CSS file can't/shouldn't be bundled with the Theme.
>>
>>
> The URL is indeed an external resource  for Google Fonts. The theme author
> had hard-coded the link so I recommended using  wp_enqueue_style hooked into
> wp_head().
>
>  -----
> Vicky Arulsingam
>
>
> _______________________________________________
> 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/20110603/83869bad/attachment.htm>


More information about the theme-reviewers mailing list