[theme-reviewers] Need clarification on guidelines
Otto
otto at ottodestruct.com
Tue Sep 30 07:00:53 UTC 2014
It would be best to say that that approach is allowed, but doing it with
enqueue is probably somewhat better form.
If you examine Twenty Fourteen, you'll see that it has a function in the
functions.php file called twentyfourteen_scripts(). This function is hooked
to the "wp_enqueue_scripts" action hook, and it loads all the various
scripts and styles and such
One of those styles is the main stylesheet, determined by
get_stylesheet_url(). It adds that stylesheet like this:
wp_enqueue_style( 'twentyfourteen-style', get_stylesheet_uri(), array(
'genericons' ) );
Note that it also declares the main theme stylesheet dependent on the
genericons stylesheet as well, to ensure that that stylesheet is also
loaded.
Having your stylesheets declared like this and enqueued can make them
easier to organize and reference, especially if your theme is complex.
-Otto
On Tue, Sep 30, 2014 at 12:56 AM, Emil Uzelac <emil at uzelac.me> wrote:
> no problem :)
>
>
> On Tuesday, September 30, 2014, Michael Hebenstreit <michael at mhthemes.com>
> wrote:
>
>> Good to know - thanks for the link. :-)
>>
>>
>> Am 30.09.2014 um 07:48 schrieb Emil Uzelac <emil at uzelac.me>:
>>
>> Sorry but the correct answer is yes
>> https://make.wordpress.org/themes/handbook/guidelines/template-tags-and-hooks/#including-stylesheets-and-scripts
>>
>> On Tuesday, September 30, 2014, Michael Hebenstreit <michael at mhthemes.com>
>> wrote:
>>
>>> Hi,
>>>
>>> no, you should enqueue stylesheets like this:
>>> http://codex.wordpress.org/Function_Reference/wp_enqueue_style
>>>
>>> Cheers,
>>> Michael
>>>
>>>
>>> Am 30.09.2014 um 07:39 schrieb mudthemes support <contact at mudthemes.com
>>> >:
>>>
>>> > I have created a theme and have put stylesheet (style.css) into the
>>> <head> section of header.php using the following code:
>>> >
>>> > <link rel="stylesheet" href="<?php echo get_stylesheet_uri() ?>"
>>> type="text/css" media="all" />
>>> > <?php wp_head(); ?>
>>> > </head>
>>> >
>>> > The question is that whether this is prohibited or is it okay?
>>> > _______________________________________________
>>> > 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/20140930/796b481d/attachment-0001.html>
More information about the theme-reviewers
mailing list