Parent/Child Themes in WordPress: The Future of WordPress Themes

WordPress 2.7 now features parent/child WordPress Themes, a new feature that protects installed WordPress Themes while allowing customization. Customizations are storied in the “child” Theme, which loads first. If a Child Theme isn’t detected, WordPress loads the “parent” Theme.

If you do not intend on making any customization to your WordPress Theme on your WordPress blog, then this issue isn’t for you. If you are planning on designing your own Theme for your own use, then this also doesn’t pertain to you.

However, if you are using a WordPress Theme that you want to customize and not lose the customization features when the Theme upgrades, then this is information you need to know.

If you are designing WordPress Themes for the public, you need to understand how WordPress Child Themes work.

Creating a strong parent WordPress Theme framework is critical for WordPress Theme development, as described in “How To Protect Your WordPress Theme Against Upgrades” by Ian Stewart, the man behind the leading drive toward including Child Themes in WordPress Core. The technique was adopted by other leading WordPress developers including Justin Tadlock, frustrated with the fear of updating WordPress Themes and protecting user customizations. Protecting the parent Theme made sense, allowing the child Theme to hold all the customization, protected from being overwritten by updates to the Parent.

Think of the parent/child feature of WordPress like selecting blueprints for construction of your new home. You look at the various room placements and sizes, the layout, the traffic flow, the architectural specifications that you prefer. You know the decision of which floor plan to choose isn’t based upon the desire to have the walls in the kitchen painted yellow with green stonework, or the carpet in the bedrooms be blue with wood floors in the living areas. It isn’t about the wall paper, curtains, or paint. You just want the master bedroom far from the room where the kids will be playing and watching movies all night. The paint and carpets come later.

Once you have the floor plan and blueprints selected, and the house is under construction, then it’s time to start hunting up paint and carpet samples to begin the home decoration process.

The floor plan blueprint, in this simple analogy, is the parent WordPress Theme. It sets the overall structure of the design. The decorations are found in the Child Theme, with the stylesheet guiding the paint, carpet, wall paper, and home decorations.

Parent WordPress Themes come with their own design set, but the core feature of parent WordPress Themes is their ability to switch the design elements around with a child Theme.

This new feature will change how you use WordPress Themes in the future.

The Future of WordPress Themes

While part of the purpose of the parent/child WordPress Theme feature is to protect the original WordPress Theme from design changes, allowing the user to change the child Theme without impacting the original code, which makes upgrading Themes easier. The future of WordPress is moving towards implementation of auto-upgrading and installing of WordPress Themes, and reliance on parent/child Themes makes this process possible.

In the past, you would download and install any WordPress Theme and that would be it. If the license permitted it, you could customize the Theme to make it work for you and your blog. If a new version of that Theme came along, installing it on your blog would replace all your customization features. You’d have to spent time integrating your custom design modifications into the newly updated Theme. This left many Themes vulnerable to hackers as people didn’t want to go through the trouble of upgrading their Themes.

With automatic uploading and updating of WordPress Themes coming in a future version of WordPress, the parent/child Theme feature works for both purposes. The user can customize the child Theme, and next time the Theme is updated with patches, bug fixes, and security repairs, the customization features are not lost. They remain protected.

More importantly, the world of WordPress Themes will change as you will have two core choices in a WordPress Theme. You can choose a basic “parent” Theme or choose a parent Theme that has the “floor plan” or framework you like and then choose from among the various child Themes to create a customize version of the parent. This gives whole new meaning to the phrase “variations on a theme.”

For example, the popular Thematic Theme features the following child Themes to choose from to personalize the parent Thematic Theme:

Each is a variation on the Thematic Theme, giving the user a lot more options when they find the core look they like.

This makes choosing WordPress Themes for future compatibility with upcoming versions of WordPress a little more complex for long time users of WordPress, but easy for newer users not entrenched in older Theme design practices.

If you want total control over your WordPress Theme, and will not be uploading a replacement or upgrade from the WordPress Themes Directory, then it is up to you to ensure your WordPress Theme continues to be updated if security warnings are issued, and to update it yourself if WordPress changes.

If you do not want to mess around with the code of WordPress Themes, you now will have two options.

You can download any WordPress Theme as before. If upgraded from the WordPress Theme Directory, it will be replaced, and any customization lost.

You can download a parent Theme and then choose from among its one or more child Theme designs to customize the parent Theme. All customization will be stored in the child Theme.

I expect a lot of people to begin offering child Themes in addition to some interesting parent Themes. Be sure which type of Theme you are downloading when you choose one. You will need to choose a parent Theme and then a child Theme to paint the walls of your WordPress blog.

More Information on Parent/Child Themes in WordPress

Building a parent/child WordPress Theme isn’t difficult. For information on developing and working with parent/child WordPress Themes, here are some tutorials and helpful articles:

16 Comments

Thanks, Lorelle, for an interesting post. I’m often looking at new themes and, until I saw it here, I wasn’t aware of the parent – child theme concept. The next time I’m looking for something new, that is something I’ll certainly be considering.

This is great. I’m using an old version of a theme that now has been upgraded to 2.7 but when I looked into upgrading it would take DAYS to reapply all my customizations. I will wait for a parent/child theme I like and then hopefully won’t run into this problem in the future.

Justin Tadlock’s “Hybrid” is also set up for parent and child themes. ( http://themehybrid.com ) He currently has two child themes for it as well and a great support forum (paid to ask questions, but it is well worth it!!! – you can view the the forum without paying). I currently run my modification of Hybrid – that I change monthly to reflect the season.

Wow. I had no idea that WordPress had a framework in place for a parent/child theme, and it’s nice to know that this feature exists. However, the part that I’m difficulty with is that it appears, based on a few of your additional links that I read, that child themes are ONLY for dealing with changes to the CSS, not changes to the actual PHP-HTML code that controls the look-and-feel of the style. If that’s the case, then this will not be very useful to me because I make all kinds of edits and customizations to the code itself, but not very many for the CSS.

I think that this would be much more useful if it could have the ability to inherit template files as well. For example, any files that I put into the child theme will be read in the child theme, but any files that I DON’T put into the child theme will instead be read from the parent theme (the way that ALL of the files except style.css and functions.php are right now). That would be much more useful for me, because even with this current parent/child thing, I still can’t upgrade themes very easily for fear of it overriding the many edits I’ve made to the template itself.

Personally, I think that the way WordPress deals with themes (in terms of how the code is organized) is fairly archaic and hasn’t seen any significant improvements since the concept of WordPress themes was introduced with WP 1.5 nearly four years ago. This new framework for parent/child themes is definitely a step in the right direction, but I think that a number of other fundamental changes in the concept of WordPress themes need to happen before the concept of an auto theme updater will be fully accepted by the WordPress community.

@Ian: The work you have done to turn the WordPress Community on its righteous ear to really change how we handle Themes is much appreciated and honored. You are doing great work! Thanks for pushing this through as it is a fantastic idea and the community will really benefit. It’s early days and a lot of work to spread the word and teach people how this all works is critical to making it a success. Thanks again for being a driving force in this process.

Unfortunately, the theme repository at wordpress.org doesn’t accept child themes, meaning that designers are forced to bundle the base theme files along with their own if they want to take advantage of the auto-install/upgrade features promised in the future. Which sort of defeats the point of building a child theme in the first place.

In an ideal world, the developers would bundle a theme framework with the next release of WP (Kubrick is showing its age) and illustrate the concept of child themes by actually including a few. They could even run a community contest to build a child theme in a couple of days, like the one they did for icons. But since the impetus towards child themes is coming from the community rather than from within Automattic, it seems unlikely. I worry that instead they will focus on auto-update, which will effectively discourage people from downloading themes anywhere other than wordpress.org and leave child themes dead in the water :(

@that girl again: Child Themes are new. People barely know about them, let alone how to create or use them. The WordPress Theme Directory is also WAY slow in getting going on many levels, so have patience with them, too. We’re all in such a hurry. :D We want it NOW.

I agree that a Theme framework within the core default would be a fabulous idea. Up for the challenge? :D

I worry that instead they will focus on auto-update … and leave child themes dead in the water

This still makes the directory, frameworks & Child Themes great for commercial uses like keeping your client’s code up to date with code fixes (that don’t change the basic HTML-CSS structure). All your WordPress design clients can get an auto-update note and one-click later their theme is updated. In this instance, it doesn’t really matter if your Child Themes are in the directory.

As for Automattic, Andy Skelton seemed to be pretty supportive, encouraging me to code up a patch for added Child Theme functionality (other, more intelligent and beautiful people ended up coding that patch). I think his support of the idea was instrumental in getting that patch through.

Hi Lorelle – This post came at the perfect time as I’m in the process of changing my theme and the one I’m serious about has the parent/child feature. I’ll be back to reread this post in the near future.

@Jason: link, please? All I know is that they weren’t allowed a fewmonths ago and I can’t find any more recent statements on the subject, nor can I see any child themes in the directory. If the policy has changed that’s great.

I agree with @Douglas that the whole paradigm of WordPress themes is archaic and needs to be re-thought from the ground up.

The future of blog customisation is not installingthemes, but changing the look and feel of the blog using a simple WYSIWYG interface. A perfect example is Artisteer.

You should be able to point-and-click to select page layout (no. of columns, sidebar, etc), background color, menu styles, fonts,etc etc, without going into code/CSS editing or relying on 3rd-party theme developers who may or may not upgrade their themes.

In short, it’s time to make a quantum leap and abolish themes altogether.

Creating a parent a parent theme is indeed require enough knowledge in WP.Every webmaster wants his/her site to be unique, hence customization is necessary and its much easier with child and as par the complexity of the project, the child theme need to be developed.

[…] I’m using thematic. It’s a cool, customizable layout and I want to learn more about child themes. This entry was posted in The Site. Bookmark the permalink. Post a comment or leave a trackback: […]

[…] for everything related to the California outdoors. We built this WordPress website by customizing a child theme of the popular Mimbo magazine theme. Other customizations include a most popular posts list, […]

[…] Child Themes: The efficient way to modify WordPress themes November 24th, 2009 by Kasper Sorensen No comments Ever had to modify a WordPress theme, and struggled to find your way around the CSS or template files? Or, have you ever had to update a theme, just to lose all you modifications? Use child themes to modify your blog design. […]

[…] Here are the first few words: Ever had to modify a WordPress theme, and struggled to find your way around the CSS or template files? Or, have you ever had to update a theme, just to lose all you modifications? Use child themes to modify your blog design. […]

[…] Since he did that on Friday, it was my turn to fulfill my end of the deal. I installed P2, made a child theme to start tweaking it to my liking with barely any effort and voilà: simple, clean, effective, I […]

[…] Parent/Child Themes in WordPress: The Future of WordPress Themes « Lorelle on WordPress Creating a strong parent WordPress Theme framework is critical for WordPress Theme development, as described in Why I Created a WordPress Theme Framework by Justin Tadlock. With a solid framework in the parent Theme, the child Theme will integrate easily when the user makes changes to the Theme or wants to use a child Theme. […]

[…] in point 15 in that previous tutorial.) Buddymatic itself is a theme framework which includes some child themes, so you don’t need to install EarlyMorning. But installing it is easy enough that I’m […]

[…] good folks at WordPress have a solution; child themes. A child theme inherits all the functionality of another theme, the parent, allowing you to modify the look, feel and functionality of it without causing problems when that […]

[…] Creating a strong parent WordPress Theme framework is critical for WordPress Theme development, as described in Why I Created a WordPress Theme Framework by Justin Tadlock. With a solid framework in the parent Theme, the child Theme will integrate easily when the user makes changes to the Theme or wants to use a child Theme. Think of the parent/child feature of WordPress like selecting blueprints for construction of your new home. You look at the various room placements and sizes, the layout, the traffic flow, the architectural specifications that you prefer. You know the decision of which floor plan to choose isn’t based upon the desire to have the walls in the kitchen painted yellow with green stonework, or the carpet in the bedrooms be blue with wood floors in the living areas. It isn’t about the wall paper, curtains, or paint. You just want the master bedroom far from the room where the kids will be playing and watching movies all night. The paint and carpets come later. Once you have the floor plan and blueprints selected, and the house is under construction, then it’s time to start hunting up paint and carpet samples to begin the home decoration process. The floor plan blueprint, in this simple analogy, is the parent WordPress Theme. It sets the overall structure of the design. The decorations are found in the Child Theme, with the stylesheet guiding the paint, carpet, wall paper, and home decorations. Lorelle on WordPress […]

[…] in the core in WordPress 2.7. Before Child Themes, users customized their Themes then feared updates as the code would be overwritten, destroying their customization and modification. Elaborate notes had to be kept and code and […]