WP-Starter Updated to 2.1

I just anted to let everyone know that I have updated WP-Starter to v2.1 – A few days ago James Maiden of ReallyGreenWP.com asked me the following:

the best way to import the parent stylesheet without using @import (I’ve tried this, but not got it working: ​http://www.doitwithwp.com/better-alternative-import-child-themes/) – and wonder why you don’t use this in your child theme.

I thought that was a very good question and it got me thinking about why I didn’t use that in my theme. However I knew the answer and the answer was WordPress doesn’t want it that way. So I was going to copy and paste the URL to the Codex section on Child Themes and what did I see? I saw the new way of importing the parent style sheet. Here is the link if you want to check it out yourself: http://codex.wordpress.org/Child_Themes

So I decided to update WP-Starter with this new way of doing things and so far so good. Besides there hasn’t been an update yet here or at Foundation, so I thought I’d push this out while the pushing is good…lol 😉 Enjoy!

17 thoughts on “WP-Starter Updated to 2.1

  1. Don’t know if I updated correctly, but the parent style seems to load after the child theme style which means you can’t override anything ?

  2. Tried the 2.2 version on a clean WordPress install, with no modifications to the wp_starter theme. It still loads the parent theme style after the child theme style :((

  3. Actually I looked at you demo site and it is doing the same if you check the source you that the starter theme style loads before the parent theme style

    This is the order as the code above

    • You are correct the starter theme style is supposed to load before the parent theme style, this is so you can change or add any styles you want to your child theme.

      Here is the source code for ThemeAwesome.com:

      
      
      
      
      
      

      as you can see it works exactly the way its supposed to with WP-Starter css coming before the parent theme css. This is the same in the demo.

  4. If the starter style sheet loads before the parent then according to my knowledge the parent style sheet will override any styles you modified in in starter or is my knowledge of loading style sheets wrong ?

    • Sorry but your knowledge is incorrect. You want the child css to load before the parent css. This gives it priority. This allows you to add your own styles as well as overwrite the styles of the parent theme.

      When a child theme is present, everything from the child theme has priority over the parent theme. This is one of the reasons WordPress recommends you always use a child theme. If the parent theme is updated you do not lose anything you added via the child theme.

    • Hmmmm mokletsa, seems you are the one who is correct and I am the one who is wrong. I was under the impression that the child css came first with @import… however it seems that @import loads the parent styles first!

      You have my apologies for being dense as well as my thanks for teaching me something. As I have always said, I always learn something new about WordPress everyday.

      Also I believe I may have caused an issue in redoing WP-Starter. Kel from over at BadCat.com sent me an email stating:

      Something odd is going on with the dropdown menus – I noticed it on the starter theme first but also seems to be here on themeawsome.com too.

      Usually? rolling over a dropdown menu allows it to drop and reveal the submenu items. But now I’m just seeing the # and a click doesn’t show the submenu – it simply adds the hash to the URL and I never get to see the submenu.

      So I am going to backtrack and see what I can see and fix whatever it is. I do not believe its WP-Forge. This all has started since I redid WP-Starter. I am going to take a look now and like I told Kel, if I find something wrong I will let everyone know and fix it.

      Thanks again mokletsa 😉

      • Hi thomas, I got the menus working by recopying the wpforge functions.js to the wpstarter wpstarter-functions.js (Something must have gone wrong when copying the contents from the functions.js

  5. No problem Thomas, we are here to help each other. Any here is the modified wpstarter_style_scripts, I used to correctly order the styles.

    function wpstarter_style_scripts() {
    wp_dequeue_style(‘wpforge’);
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );
    wp_enqueue_style( ‘child-style’, get_stylesheet_uri(), array( ‘parent-style’ ) );
    wp_enqueue_script( ‘wpstarter-js’, get_stylesheet_directory_uri() . ‘/js/wpstarter-functions.js’, array(), ”, true );
    }

Leave a Comment