Child theme stylesheet loading twice
-
I created a twentyfourteen child theme.
https://codex.www.ads-software.com/Child_Themes instructed me to add this to the functions.php in my child theme directory:
<?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') ); }
It then appeared that the functions.php in the parent theme directory was enqueueing the child stylesheet as well. I took this out of functions.php in parent theme:
wp_enqueue_style( 'twentyfourteen-style', get_stylesheet_uri(), array( 'genericons' ) );
No idea about the ‘genericons’ bit, but this seems to have fixed it. Anyone have any thoughts regarding this approach?
- The topic ‘Child theme stylesheet loading twice’ is closed to new replies.