[HOWTO] WordPress Child Themes

Here is an easy was to keep your custom edits to the theme php files.

We need to create a child theme that uses the garland core files for the main theme functions as well as and custom code you add, then when you update the theme from within wordpress only the parent theme will get changed, your child theme will remain intact!

first off we create a new folder within the themes dir and give it a name, inside it we put a style.css file. Ive chosen garland-redux for this example as were protecting my garland theme from changes…we still need the original garland-revisited theme folder, so dont go deleting it!

so your directory path will look like this:

wp-content
|_themes
        |_garland-revisited
        |_garland-redux
                       |_style.css

The format for the style.css file is simple, it just tells the child theme where the parent is:

/*
Theme Name: Garland-redux
Theme URI: http://www.pross.org.uk
Description: Testing WordPress Child Themes
Author: Simon Prosser
Author URI:http://www.pross.org.uk
Template: garland-revisited
Version: 1.0
.
This work, like WordPress, is released under GNU General Public License, version 2 (GPL).
http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
.
*/

@import url('../garland-revisited/style.css');
Pages: 1 2

3 Comments

  1. [HOWTO] Wordpress Child Themes on 2nd August 2009 at 10:27 pm

    […] View original post here:  [HOWTO] WordPress Child Themes […]

  2. [HOWTO] Wordpress Child Themes | bllogger on 3rd August 2009 at 3:00 am

    […] more here:  [HOWTO] WordPress Child Themes internet […]

  3. Maxwell Pink on 3rd August 2009 at 3:07 pm

    Thank you for the post! And here I thought Child Themes were just themes inspired by other themes. 🙂
    Since I still have to upgrade Garland, I’ll do that today and then give this a try. I’ll let you know how it works!

Leave a Comment