The pros and cons of using WordPress child themes
Quite possibly the best part about using WordPress is the availability of a large number of readymade themes that can be installed within minutes to give your website a modern look. Whether you opt for free WordPress themes or purchase a premium one, the choices are plenty when it comes to picking the ideal theme for your WordPress website or blog.
However, it is not often that a theme fully suffices for the requirements and needs of your website, and in such cases, minor tweaks, customizations, and edits might be needed in order to give your website that unique look and feel. Now, when it comes to customizing an existing WordPress theme, there is one concept that many WordPress users tend to ignore: the role of child themes.
What is a child theme?
In simple words, a child theme is one which inherits its functionality from an existing parent theme. As such, a child theme can inherit the functionality, features, and behavior of its parent theme, and even extend them by means of customization. You can modify the styles and appearance of the parent theme by editing the child theme, and at the same time upgrade the parent theme without affecting the appearance of the child theme.
How to create a custom WordPress theme using child themes
You may be familiar with the WordPress proverb: don’t hack core. (If you’re not familiar with it, YOU SHOULD BE!) There should be a second one to go along with it: don’t hack themes! But if you ...
Quite obviously, the direct logic behind using a child theme is to ensure that your changes to the theme design are not lost if and when the parent theme is updated. Furthermore, you can also experiment with the child theme without actually messing with the parent theme’s code. In fact, there are several WordPress themes out there that are meant to function as pure parent themes — commonly called theme frameworks, such as Genesis or Hybrid Core.
That said, what real advantages does a child theme have to offer?
Advantages of using a child theme
First up, as already mentioned, using a child theme ensures that your customizations and tweaks are not lost when the parent theme is updated. Picture this: what if you edit the parent theme directly, and then later on, a security exploit is discovered and you are required to update the theme urgently? You will either have to lose your customizations, or risk the security of your website by not updating the parent theme. By using a child theme, you can steer clear of such problems.
Secondly, child themes are easy to extend, and you can selectively edit certain features without actively modifying all the template files.
Third, since the child theme rests on the shoulders of a parent theme, you can be sure of backwards-compatibility and a fallback model, lest you forget to add support for something in your child theme. The parent theme’s features will have you covered by default, and you can just focus on the customizations, rather than building the theme from scratch. This can be a real time-saver!
Disadvantages of using a child theme
However, much like everything else out there, using a child theme can have its own share of pitfalls and issues as well.
Arguably the biggest disadvantage is whether a child theme is worth the trouble or not? If you are making big changes to the parent theme, yes, a child theme will save you a lot of trouble. But what if you just wish to remove the © logo from the footer of a given theme? It might just be simple enough to rely on Jetpack’s Custom CSS module in such cases.
Beyond that, the success and failure of your child theme depends totally on its parent theme. For example, what if your parent theme reaches the end of its life and is no longer actively maintained by the developers? Of course, all thanks to GPL you can still maintain the parent theme all by yourself, but then that kind of defeats the purpose of building a child theme.
The above problem can, however, be fixed by being judicious with the selection of the parent theme. Technically speaking, any theme in WordPress can act as a parent theme. But not all themes make good parents! A good choice here is to rely on themes that have “parent theme” as their USP, or have been in active development and will continue to be maintained for a good while to come. Genesis is a good choice because they have created an empire by telling people to build child themes, so they probably will not run away after the weekend. Similarly, opting for themes released by reputed developers is also a good choice, because in all likelihood, they will not be leaving you stranded with no support or updates.
All said and done, a child theme can be very handy if you plan on making big changes to your WordPress theme. Not only will the child theme save precious development time, it will also ensure that future security updates do not compel you to lose your customizations.
Have you worked with a child theme? How has your experience been?
One other drawback with child themes is with using ready made child themes. Since WordPress doesn’t have grandchild themes any necessary modifications would have to be made to the child itself.
But when the child is updated in the future, you won’t be able to update it smoothly. In order to update you’ll have to make your modifications a second time. It’s not very efficient.
I recently built a little plugin to permit update-safe customizing of framework child themes (e.g. Genesis – my reason for developing the plugin in the first place). WP Clips creates a simple plugin repository for custom code and has quite a few other features. Would love to hear your thoughts … http://wpclips.net