Title: Child Theme CSS file loading twice
Last modified: July 31, 2017

---

# Child Theme CSS file loading twice

 *  [buffyfan](https://wordpress.org/support/users/buffyfan/)
 * (@buffyfan)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/child-theme-css-file-loading-twice/)
 * The same CSS file is appearing in dev tools twice. The [codex ](https://codex.wordpress.org/Child_Themes)
   warned about this but I can’t see where I’ve gone wrong
 *     ```
       function storefrontchild_enqueue_styles() {
   
           $parent_style = 'storefront-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.
   
           wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
           wp_enqueue_style( 'child-style',
               get_stylesheet_directory_uri() . '/style.css',
               array( $parent_style ),
               wp_get_theme()->get('Version')
           );
       }
       add_action( 'wp_enqueue_scripts', 'storefrontchild_enqueue_styles' );
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [HudsonValleyWebDesign](https://wordpress.org/support/users/jaycbrf/)
 * (@jaycbrf)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/child-theme-css-file-loading-twice/#post-9366792)
 * link?
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/child-theme-css-file-loading-twice/#post-9367924)
 * As the Codex warned, using the wrong handle can cause this. I’ll assume you’ve
   double checked this and ‘storefront-style’ is truly the correct handle. Some 
   themes load their stylesheets differently than the normal convention such that
   WP cannot see that the sheet has already been linked. In such a case, you should
   then be able to simply comment out the `wp_enqueue_style( $parent_style, //...`
   line in your callback. The parent sheet will be loaded with the other parent 
   files.
 * Verify the parent sheet is still loaded and your stylesheet is loaded after the
   parent theme’s. If it is loaded before, your styles will not easily override 
   the parent’s. To cause it to load later, remove the `$parent_style` from your
   stylesheet’s dependency array and add a large priority parameter to your add_action()
   call.
 *  Thread Starter [buffyfan](https://wordpress.org/support/users/buffyfan/)
 * (@buffyfan)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/child-theme-css-file-loading-twice/#post-9369321)
 * Looks like I missed this from the Woocommerce site (hidden away)
 * “Note: With Storefront you do not need enqueue any of the parent theme style 
   files with PHP from the themes functions.php file or [@import](https://wordpress.org/support/users/import/)
   these into the child themes style.css file as the main parent Storefront theme
   does this for you.”
 * I really dislike it when people stray from conventions.
    -  This reply was modified 8 years, 9 months ago by [buffyfan](https://wordpress.org/support/users/buffyfan/).

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Child Theme CSS file loading twice’ is closed to new replies.

## Tags

 * [child theme](https://wordpress.org/support/topic-tag/child-theme/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [buffyfan](https://wordpress.org/support/users/buffyfan/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/child-theme-css-file-loading-twice/#post-9369321)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
