WordCamp Las Vegas 2010: Child Themes vs. Theme Frameworks

Here is the (heavily) edited transcription

Comparing Child Themes vs. Theme Frameworks

In order to properly compare these two different approaches to selecting a theme, we first need to define and understand what each approach means. While the goal behind choosing either a parent/child theme pair or a theme framework is to make it easier for developers to get started quickly, the way that development continues can be vastly different.

Parent/Child Themes

The parent/child theme structure is most often used when you or your customer finds a theme that is more-or-less what is desired, but needs a few small changes. WordPress is set up to allow you to reference most themes as a “parent”. This means you can create a “child” theme that references and inherits the styling and functionality of the “parent” theme and add or override that functionality to implement your customizations.

The way this is set up has some additional benefits as well. Using a child theme allows you to compartmentalize your changes so that you can freely update your parent theme as new releases are made without losing any of your customizations in the process. The updates to your parent theme may resolve security concerns, add new functionality, or contain accessibility updates. Whatever changes are being released, you don’t want to be left behind because you can’t update your theme.

Just about any theme can be a parent theme. Whether you find it on the WordPress.org theme repository, in your WordPress dashboard, or from a premium vendor or marketplace, most themes you buy or create can be leveraged as a parent theme. As long as the theme is developed using WordPress best practices, it can be used, without modification, as a parent theme.

Just the Changes

Because child themes only contain the changes you want to make, they are typically much smaller in size and content. In order to make a child theme, there is only one requirement – a child theme must have a style.css file. The style.css file will have a line in the header that references the parent theme. WordPress will take care of the rest!

In fact, the most basic child theme can just be changes to the CSS. A child theme can also contain a subset of the template files that you want to change. For example, if you want to change the HTML markup for your header, you can copy the header.php file from the parent into the child and make your changes to the file in the child theme. WordPress will automagically use the header.php file from the child theme in place of the header.php file in the parent theme.

Once a theme is established as a child theme, WordPress knows to look for files in your child theme first and default to files from the parent theme to fill the gaps. The only exception to this rule is for functions.php. This special file is included from both the parent and the child theme. This allows you to extend the functionality of your parent theme without having to recreate it.

Theme Frameworks

Another way to avoid starting from scratch with theme development is to use a theme framework. Theme frameworks are similar to parent/child themes in that you usually want to use the theme framework as a parent for a custom child theme. There are a number of ways that theme frameworks differ from normal parent themes.

Theme frameworks are typically basic in style. They usually come in a grayscale color palette and are mostly structural in nature. They provide a solid foundation for further customization. These themes are not usually ones that you would use out of the box without customizing.

The audience for a theme framework is usually more developer-minded. Theme frameworks provide developers with a code-oriented approach to modifications. They usually make heavy use of WordPress hooks – actions and filters. These allow developers to add and remove blocks of code without having to create full template files.

Often times, developers of theme frameworks will have also created a number of child themes. These child themes apply styling and/or functionality for a particular use case. The Genesis framework is an excellent example of a theme framework that takes this approach. This does make it a little tricky to implement changes though. You don’t want to make changes to your theme because you won’t be able to update your theme. Since WordPress doesn’t allow for Grandchild themes, developers usually end up making custom plugins to implement features for a theme. This requires a little different mentality and skillset.

Child Themes vs. Theme Frameworks

Now that we have an understanding of how these two theme types work, compare the different use cases for each. Both methodologies allow you to drastically reduce your theme development efforts by leveraging a well-tested theme. They also allow you to continue to receive updates and features from the originating developer without losing your customizations in the process. But this is where the similarities end.

The real difference comes from how you approach your customizations and why you chose the theme in the first place. If you’re a developer and are very comfortable with actions and filters, using a theme framework will greatly speed up your customization process. This will also give you the most flexibility as you can apply any design ideas you have to the theme.

On the other hand, if you have a theme that you already love and it does 95% of what you need it to do, making a simple child theme from that will be the easiest approach for you. Most anyone with some basic HTML, CSS, and WordPress knowledge will be able to complete a customization of this kind.

Whichever method you choose, you can rest easy knowing that you can stay up-to-date with the latest developments. If you’re embarking on implementing a new design for your website and would like to work with us to make it shine, we’d love to hear about your project.

Please note: Links to external companies may be affiliate links. If you use our links, we may earn a small commission.

Similar Posts