lilaulan
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Child theme stylesheet loading twiceYes that does it. (And it should have been obvious, sorry.) Thank you so much!
Forum: Themes and Templates
In reply to: Child theme stylesheet loading twiceCould you explain why it shouldn’t work in my case, please? I don’t see any difference between the original poster’s problem and mine.
Forum: Themes and Templates
In reply to: Child theme stylesheet loading twiceThat didn’t work for me. I still get the exact same link tags in the head.
Forum: Themes and Templates
In reply to: Child theme stylesheet loading twiceI’m having this same issue with a test site I’m working on (unfortunately not available publicly). I’ve created a child theme of the twentytwelve theme and added this code to the child theme’s function.php:
add_action( 'wp_enqueue_scripts', 'enqueue_child_theme_styles', PHP_INT_MAX); function enqueue_child_theme_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_uri(), array('parent-style') ); }Here’s what I find in the head of my site:
<link rel='stylesheet' id='twentytwelve-style-css' href='http://testsite/blog/wp-content/themes/twenty-twelve-child/style.css?ver=4.0' type='text/css' media='all' /> <!--[if lt IE 9]> <link rel='stylesheet' id='twentytwelve-ie-css' href='http://testsite/blog/wp-content/themes/twentytwelve/css/ie.css?ver=20121010' type='text/css' media='all' /> <![endif]--> <link rel='stylesheet' id='parent-style-css' href='http://testsite/blog/wp-content/themes/twentytwelve/style.css?ver=4.0' type='text/css' media='all' /> <link rel='stylesheet' id='child-style-css' href='http://testsite/blog/wp-content/themes/twenty-twelve-child/style.css?ver=4.0' type='text/css' media='all' />FireFox and Chrome developer tools show that the rules in twenty-twelve-child/style.css are overridden by the rules in twentytwelve/style.css. And then those rules are overridden by the rules in twenty-twelve-child/style.css.