Title: Parent stylesheet loading after child
Last modified: August 24, 2016

---

# Parent stylesheet loading after child

 *  Resolved [eSaner](https://wordpress.org/support/users/esaner/)
 * (@esaner)
 * [11 years ago](https://wordpress.org/support/topic/parent-stylesheet-loading-after-child/)
 * Just a note to other’s that might run into this problem:
 * I’m using WP-Forge as a parent theme with a customized version of WP-Starter 
   as a child theme. After recently updating WP-Forge I noticed that its stylesheet
   was loading after the child theme’s stylesheet.
 * I’m enqueueing the parent theme in functions.php of the child theme as described
   here: [https://codex.wordpress.org/Child_Themes](https://codex.wordpress.org/Child_Themes).
   If I also enqueue the child theme stylesheet as a dependency of the parent theme,
   the child theme stylesheet is loaded twice, once before the parent theme’s and
   once after.
 * I traced this to line 212 of functions.php in WP-Forge, where the wpforge_scripts()
   function calls get_stylesheet_uri(). When a child theme is used, get_stylesheet_uri()
   will point to the child theme’s stylesheet, instead of the parent theme’s stylesheet.
   This function is loaded at priority 0, so if you use the function from the WP
   codex that only enqueues the parent theme as is (without specifying a priority),
   the default priority of 10 causes the parent theme’s stylesheet to load after
   the child’s stylesheet.
 * This is solved by adding a priority of 0 to the function in the child theme’s
   functions.php that enqueues that parent theme’s styles (child functions.php is
   loaded before parent). The odd thing about this solution is that when the child
   theme stylesheet is loaded in the <head>, it’s listed with id=”wpforge-css”, 
   even though it’s not from that theme. There’s also a version number appended 
   to the url that is inaccurate.
 * Perhaps there’s a better way to fix this, but that was the best I could come 
   up with.

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

 *  Theme Author [ThemeAWESOME](https://wordpress.org/support/users/tsquez/)
 * (@tsquez)
 * [11 years ago](https://wordpress.org/support/topic/parent-stylesheet-loading-after-child/#post-6081539)
 * Hey there,
 * Glad you are using WP-Forge as well as WP-Starter.
 * In regards to WP-Starter, I believe the version of WP-Starter you are using may
   be old. Version 3.0 uses the following:
 *     ```
       /**
        * Enqueue our child-theme style sheets
        */
       function wpstarter_child_style() {
           wp_dequeue_style('wpforge');
           wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css', '', '3.0' );
           wp_enqueue_style( 'child-style', get_stylesheet_uri(), array( 'parent-style' ), '3.0' );
       }
       add_action( 'wp_enqueue_scripts', 'wpstarter_child_style');
       ```
   
 * You can even see this on the Github repo: [https://github.com/tsquez/wp-starter/blob/master/functions.php](https://github.com/tsquez/wp-starter/blob/master/functions.php)
 * A user came up with the idea of doing it this way and it has been in place for
   a while, 3 months as a matter of fact. Also no priority is needed. Works like
   a charm. If you like you can see it by viewing the page source of ThemeAwesome.
 * Again thank you for using WP-Forge as well as WP-Starter. If you can please leave
   a review. Enjoy!
 *  Thread Starter [eSaner](https://wordpress.org/support/users/esaner/)
 * (@esaner)
 * [11 years ago](https://wordpress.org/support/topic/parent-stylesheet-loading-after-child/#post-6081556)
 * That’s a nicer solution. Thanks!
 *  Theme Author [ThemeAWESOME](https://wordpress.org/support/users/tsquez/)
 * (@tsquez)
 * [11 years ago](https://wordpress.org/support/topic/parent-stylesheet-loading-after-child/#post-6081629)
 * Very welcome.

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

The topic ‘Parent stylesheet loading after child’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/wp-forge/6.5.3.1/screenshot.png)
 * WP-Forge
 * [Support Threads](https://wordpress.org/support/theme/wp-forge/)
 * [Active Topics](https://wordpress.org/support/theme/wp-forge/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/wp-forge/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/wp-forge/reviews/)

## Tags

 * [child theme](https://wordpress.org/support/topic-tag/child-theme/)
 * [parent theme](https://wordpress.org/support/topic-tag/parent-theme/)
 * [Stylesheet](https://wordpress.org/support/topic-tag/stylesheet/)
 * [wp-starter](https://wordpress.org/support/topic-tag/wp-starter/)

 * 3 replies
 * 2 participants
 * Last reply from: [ThemeAWESOME](https://wordpress.org/support/users/tsquez/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/parent-stylesheet-loading-after-child/#post-6081629)
 * Status: resolved