[theme-reviewers] Need clarification on guidelines

mudthemes support contact at mudthemes.com
Wed Oct 1 05:28:57 UTC 2014


Thanks @otto, @emil and everyone.

Regards.


On 2014-09-30 07:51, Edward Caissie wrote:
> IF the theme only has the one style sheet (and nothing else to
> enqueue) there is no great reason why they should not be allowed to
> use the "old" default method of adding the required `style.css`
> template file "directly in the document head" ... now, if they are
> more complex (as in multiple stylesheets) and/or are also enqueueing
> scripts as well, I see no reason not to recommend the method Otto
> pointed out that Twenty Fourteen uses although the author can still
> add the default stylesheet as the current guidelines allow.
> 
> Edward Caissie
> aka Cais.
> 
> On Tue, Sep 30, 2014 at 4:28 AM, Ulrich Pogson
> <grapplerulrich at gmail.com> wrote:
> 
>> Why are "Themes may OPTIONALLY link the default stylesheet
>> (style.css) directly in the document head"?
>> 
>> On 30 September 2014 10:07, Michael Hebenstreit
>> <michael at mhthemes.com> wrote:
>> 
>> Hi Otto,
>> 
>> thanks for the clarification. That’s actually what I also meant
>> with my answer. I thought that doing it with the function is the
>> only correct way. I was not aware that the guideline says that you
>> can also add the stylesheet manually to the header.php. I also
>> don’t think that it’s good to have this as a guideline as some
>> novice authors may think that’s it’s a good approach to just
>> load stuff in header.php instead of using a hook properly. 
>> 
>> Regards,
>> 
>> Michael
>> 
>> Am 30.09.2014 um 09:00 schrieb Otto <otto at ottodestruct.com>:
>> 
>> 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
>> [1]
>> 
>> 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 [2]
>> 
>> 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 [3]
>> 
>> _______________________________________________
>> theme-reviewers mailing list
>> theme-reviewers at lists.wordpress.org
>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers [3]
>> _______________________________________________
>> theme-reviewers mailing list
>> theme-reviewers at lists.wordpress.org
>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers [3]
> 
> _______________________________________________
>  theme-reviewers mailing list
>  theme-reviewers at lists.wordpress.org
>  http://lists.wordpress.org/mailman/listinfo/theme-reviewers [3]
> 
>  _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers [3]
> 
> _______________________________________________
>  theme-reviewers mailing list
>  theme-reviewers at lists.wordpress.org
>  http://lists.wordpress.org/mailman/listinfo/theme-reviewers [3]
> 
> _______________________________________________
>  theme-reviewers mailing list
>  theme-reviewers at lists.wordpress.org
>  http://lists.wordpress.org/mailman/listinfo/theme-reviewers [3]
> 
> 
> 
> Links:
> ------
> [1]
> https://make.wordpress.org/themes/handbook/guidelines/template-tags-and-hooks/#including-stylesheets-and-scripts
> [2] http://codex.wordpress.org/Function_Reference/wp_enqueue_style
> [3] 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


More information about the theme-reviewers mailing list