Question Protected by Community
5 Removed header
source | link

Please read before marking as duplicate! It might be, but I searched a lot before posting this. Thank you!

Please read before marking as duplicate! It might be, but I searched a lot before posting this. Thank you!

    Tweeted twitter.com/#!/StackWordPress/status/518700501634777088
4 added 878 characters in body
source | link
function twentythirteen_scripts_styles() {
    // ...

    // wp_enqueue_style(Add 'twentythirteen/A.css'Genericons font, ..used in the main stylesheet. 
 ); <-- MUST BEwp_enqueue_style( ENQUEUED'genericons', BEFOREget_template_directory_uri() style.css '/genericons/genericons.css', array(), '3.03' );

    // Loads our main stylesheet.
    wp_enqueue_style( 'twentythirteen-style', get_stylesheet_uri(), array(), '2013-07-18' );
    // Note usage of get_stylesheet_uri() which actually enqueues child-theme/style.css

    // Loads the Internet Explorer specific stylesheet.
    wp_enqueue_style( 'twentythirteen-ie', get_template_directory_uri() . '/Bcss/ie.css', ...array( 'twentythirteen-style' );, <'2013-07- MUST BE ENQUEUED AFTER18' style.css);
}
add_action( 'wp_enqueue_scripts', 'twentythirteen_scripts_styles' );

Added Agenericicons.css and Bie.css style sheets in parent theme to clarify why I can't change the @import css statement to wp_enqueue_style in my child theme. Currently, with an @import statement in my child theme's style.css, I have this order in generated pages:

  1. twentythirteen/Agenericons/genericons.css -> enqueued by parent theme
  2. child-theme/style.css -> enqueued by parent theme, @imports twentythirteen/style.css
  3. twentythirteen/Bcss/ie.css -> enqueued by parent theme
  4. child-theme/css/main.css -> enqueued by child theme
  1. twentythirteen/Agenericons/genericons.css -> enqueued by parent theme
  2. child-theme/style.css -> empty, enqueued by parent theme
  3. twentythirteen/Bcss/ie.css -> enqueued by parent theme
  4. twentythirteen/style.css -> enqueued by child theme as dependency of main.css
  5. child-theme/css/main.css -> enqueued by child theme

ThisNote that ie.css is now included before the parent theme's style.css. I do not correctwant to change the enqueuing order of the parent theme's css files because I cannot presume that this won't cause problems with the priority of css rules.

function twentythirteen_scripts_styles() {
    // ...

    // wp_enqueue_style( 'twentythirteen/A.css', ... ); <-- MUST BE ENQUEUED BEFORE style.css

    // Loads our main stylesheet.
    wp_enqueue_style( 'twentythirteen-style', get_stylesheet_uri(), array(), '2013-07-18' );

    // wp_enqueue_style( 'twentythirteen/B.css', ... ); <-- MUST BE ENQUEUED AFTER style.css
}
add_action( 'wp_enqueue_scripts', 'twentythirteen_scripts_styles' );

Added A.css and B.css style sheets in parent theme to clarify why I can't change the @import css statement to wp_enqueue_style in my child theme. Currently, I have this order in generated pages:

  1. twentythirteen/A.css
  2. child-theme/style.css -> @imports twentythirteen/style.css
  3. twentythirteen/B.css
  4. child-theme/css/main.css
  1. twentythirteen/A.css
  2. child-theme/style.css -> empty
  3. twentythirteen/B.css
  4. twentythirteen/style.css
  5. child-theme/css/main.css

This is not correct.

function twentythirteen_scripts_styles() {
    // ...

    // Add Genericons font, used in the main stylesheet. 
    wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.03' );

    // Loads our main stylesheet.
    wp_enqueue_style( 'twentythirteen-style', get_stylesheet_uri(), array(), '2013-07-18' );
    // Note usage of get_stylesheet_uri() which actually enqueues child-theme/style.css

    // Loads the Internet Explorer specific stylesheet.
    wp_enqueue_style( 'twentythirteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentythirteen-style' ), '2013-07-18' );
}
add_action( 'wp_enqueue_scripts', 'twentythirteen_scripts_styles' );

Added genericicons.css and ie.css style sheets in parent theme to clarify why I can't change the @import css statement to wp_enqueue_style in my child theme. Currently, with an @import statement in my child theme's style.css, I have this order in generated pages:

  1. twentythirteen/genericons/genericons.css -> enqueued by parent theme
  2. child-theme/style.css -> enqueued by parent theme, @imports twentythirteen/style.css
  3. twentythirteen/css/ie.css -> enqueued by parent theme
  4. child-theme/css/main.css -> enqueued by child theme
  1. twentythirteen/genericons/genericons.css -> enqueued by parent theme
  2. child-theme/style.css -> empty, enqueued by parent theme
  3. twentythirteen/css/ie.css -> enqueued by parent theme
  4. twentythirteen/style.css -> enqueued by child theme as dependency of main.css
  5. child-theme/css/main.css -> enqueued by child theme

Note that ie.css is now included before the parent theme's style.css. I do not want to change the enqueuing order of the parent theme's css files because I cannot presume that this won't cause problems with the priority of css rules.

3 added 807 characters in body
source | link
function twentythirteen_scripts_styles() {
    // ...

    // wp_enqueue_style( 'twentythirteen/A.css', ... ); <-- MUST BE ENQUEUED BEFORE style.css

    // Loads our main stylesheet.
    wp_enqueue_style( 'twentythirteen-style', get_stylesheet_uri(), array(), '2013-07-18' );

    // wp_enqueue_style( 'twentythirteen/B.css', ... ); <-- MUST BE ENQUEUED AFTER style.css
}
add_action( 'wp_enqueue_scripts', 'twentythirteen_scripts_styles' );

Have I missed something? Any suggestions?

edit

Added A.css and B.css style sheets in parent theme to clarify why I can't change the @import css statement to wp_enqueue_style in my child theme. Currently, I have this order in generated pages:

  1. twentythirteen/A.css
  2. child-theme/style.css -> @imports twentythirteen/style.css
  3. twentythirteen/B.css
  4. child-theme/css/main.css

If I enqueue the parent's style.css as a dependency of main.css, this will become:

  1. twentythirteen/A.css
  2. child-theme/style.css -> empty
  3. twentythirteen/B.css
  4. twentythirteen/style.css
  5. child-theme/css/main.css

This is not correct.

function twentythirteen_scripts_styles() {
    // ...

    // Loads our main stylesheet.
    wp_enqueue_style( 'twentythirteen-style', get_stylesheet_uri(), array(), '2013-07-18' );

    // ...
}
add_action( 'wp_enqueue_scripts', 'twentythirteen_scripts_styles' );

Have I missed something? Any suggestions?

function twentythirteen_scripts_styles() {
    // ...

    // wp_enqueue_style( 'twentythirteen/A.css', ... ); <-- MUST BE ENQUEUED BEFORE style.css

    // Loads our main stylesheet.
    wp_enqueue_style( 'twentythirteen-style', get_stylesheet_uri(), array(), '2013-07-18' );

    // wp_enqueue_style( 'twentythirteen/B.css', ... ); <-- MUST BE ENQUEUED AFTER style.css
}
add_action( 'wp_enqueue_scripts', 'twentythirteen_scripts_styles' );

Have I missed something? Any suggestions?

edit

Added A.css and B.css style sheets in parent theme to clarify why I can't change the @import css statement to wp_enqueue_style in my child theme. Currently, I have this order in generated pages:

  1. twentythirteen/A.css
  2. child-theme/style.css -> @imports twentythirteen/style.css
  3. twentythirteen/B.css
  4. child-theme/css/main.css

If I enqueue the parent's style.css as a dependency of main.css, this will become:

  1. twentythirteen/A.css
  2. child-theme/style.css -> empty
  3. twentythirteen/B.css
  4. twentythirteen/style.css
  5. child-theme/css/main.css

This is not correct.

2 added 213 characters in body
source | link
1
source | link