mennake / thematic

Automatically exported from code.google.com/p/thematic
0 stars 0 forks source link

wp_enqueue main stylesheet versus wp_print_styles for style.css #137

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
if we want to enqueue the main stylesheet with all the other stylesheets then 
we should remove

// Loading the stylesheet
thematic_create_stylesheet();

from header.php and enqueue it by

function thematic_create_stylesheet() {
    wp_enqueue_style('thematic_style', get_stylesheet_uri() );
}
add_action('wp_enqueue_scripts','thematic_create_stylesheet');

if we want to print out the main stylesheet before the rest of wp_head then 
we'd want to leave thematic_create_stylesheet() where it is in header.php but 
change the function to:

function thematic_create_stylesheet() {
    wp_register_style('thematic_style', get_stylesheet_uri() );
    wp_print_styles('thematic_style');
}

right now we're sort of in between.  i guess it depends on how important it is 
that style.css come absolutely first and before any other stylesheets that 
plugins add... or even more importantly before any stylesheets enqueued by a 
child theme.  

Original issue reported on code.google.com by helgathe...@gmail.com on 26 Jan 2012 at 10:29

GoogleCodeExporter commented 9 years ago
r817

* Moved: enqueue of comment repy scipt to <code>thematic_head_scripts()</code>
* Deprecated: thematic_show_commentreply;
* Replaced: <code>get_bloginfo(*)</code> for Theme Review required functions
* Moved: <code>thematic_create_contenttype()</code> within header.php for Theme 
Review compliance
* Removed: <code>wp_register_*</code> because <code>wp_enqueue_*</code> 
registers * when the src param is set for <code>_scripts</code> and 
<code>_styles</code>
* Moved: Function <code>thematic_head_scripts</code> to header.php
* Changed: the action hook for <code>thematic_head_scripts()</code> and 
<code>thematic_create_stylesheet()</code> to <code>wp_enqueue_scripts</code>

See:
http://wp.me/pbNCB-t4

Please review to verify fix.

Original comment by eugene.m...@gmail.com on 30 Jan 2012 at 12:27