2

Twenty Thirteen uses wp_enqueue_style( 'twentythirteen-style', get_stylesheet_uri() ); in functions.php.

Wheter I use it or not use it in twentythirteen-child/functions.php the style.css from Child Theme is loaded (it is always loaded) and style.css from parent theme can never be loaded.

This is an exception to other files added via wp_enqueue_style(), right? It doesn't behave like all the other scripts and style files that are added with wp_enqueue_script().

So, I can't load parent's style.css in the child theme other than via @import?

1 Answer 1

4

get_stylesheet_uri will return the current theme's stylesheet-- the child stylesheet if it is a child theme. While not entirely clear from the Codex entry for that function, it is clear from the entry for get_stylesheet_directory_uri, which is used by get_stylesheet_uri. What should be happening is that the child stylesheet is being enqueued twice under different slugs.

To get the parent stylesheet you need to enqueue the parent sheet with get_template_directory_uri, which always returns the parent.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.