To every WordPress site owner, holding a distinct web design not only leads to success but also helps sustain their solid position among a swarm of online rivals sprouting up every second. Being the best is great but being unique is greater. Instead of staying alike to other websites using a same popular theme, the urge to tailor-make that theme for a unique face put forward to the audience is understandable. Yet editing and customizing a WordPress theme can be quite scary. If not being done properly, you would open yourself up to the risk of vulnerable security or data loss.
In earlier days, it was hard to update a WordPress theme without losing all the changes you had made to it. That means every custom code must be recreated with every update. However, when the concept of child theme and parent theme was introduced, things become less hectic. Just as the WordPress codex put it, “A child theme is the best, safest, and easiest way to modify an existing theme, whether you want to make a few tiny changes or extensive changes.”
Child Theme vs Parent Theme
Let’s have a simple example.
Imagine you want to decorate your laptop, what options would you have? Painting directly on it? Yes, seems nice, but not quite the best tactic. What happens when you want to change the pattern? After several erasing and repainting, I am not quite sure your laptop cover would still look good. Even if you are not changing the pattern but switching to another laptop, recreating your favourite design on the new device would require a whole lot of work also. Then what can you do? In this case, laptop decal or laptop skin will do. Either re-applying or removing the “makeup” will be made easy without any headache.
The point here is: you don’t mess with the core, you leave it intact.
The same concept goes to WordPress themes. When you need a huge touch up on an existing theme (the parent theme), don’t work directly on it. Make a clone or a duplicate (the child theme) instead and do everything you want on it. It is like a protective layer staying up front while the parent theme is left unharmed in a safe place behind. When the upgrading time comes, only the parent theme is updated and all customizations in the child theme are totally preserved.
I bet you all get the idea now.
“A child theme is a theme that inherits the functionality of another theme, called the parent theme. Child themes allow you to modify, or add to the functionality of that parent theme. Instead of modifying the theme files directly, you can create a child theme and override within.” ~WordPress codex~
“The parent theme acts as a base for the child. How it works is the parent theme contains the programming that creates the function and features of your site while the child theme contains the images and styles that form the base for your site’s layout and design.” ~WPMUDev~
Say yay to child theme: Why not?
If you are not using a child theme right now, here are some reasons why you should.
You are making lots of changes to the theme
Creating a custom-style.css file or using a Custom CSS plugin will do if you only intend to make small changes to the theme. But when it comes to constantly modifying the functions.php file or style.css file of your theme, creating a child theme is a better solution to store and manage all of your overridden codes.
For a less troublesome update
As I mentioned earlier, it’s a real nightmare when it comes to theme updates. If you upgrade your theme to a new version, all customizations made to the theme’s functions or styles will be lost and have to be recreated.
However, when a child theme is activated, WordPress will first scan the template files in its folder before going to the files in the parent theme folder. This assures all custom codes in style or function you created for the child theme will never be lost during the update.
Speed up the development process
Starting a WordPress site from scratch would be much less work if you have a child theme generated from a powerful parent theme. Like we discussed above, a child theme inherits everything from the parent theme, from design to functionality. Some parent themes even include widgets and plugins that you can apply right into the child theme without fuss. Especially when you create your child theme from a good theme framework like Genesis or Twenty Eleven, you already got yourself a good code base to work on.
Easy going back and forth between theme options
Just like the example with the laptop decals/skins above, you can always switch back to the parent theme or create another child theme anytime if your initial customizations don’t turn out as good as you expect.
Finding the backbone for your child theme
So I guess the only question left now is seeking a proper parent theme to your child theme. As for DesignWall users in particular, it is good to know that every of our WordPress themes supports creating child theme and can act as a good parent theme for your web project, be it eCommerce, news, portfolio or business/personal blog.
It is true that most WordPress frameworks can become a robust parent theme, offering lots of available features. But you should stay cautious when it comes to using starter theme. Some starter themes like Roots, Underscores or Bones are meant to be the base for a parent theme. Therefore, they are not quite suitable for creating child theme.
Some may claim that most WordPress themes can have child themes, yet not all of them can be a good parent theme if they don’t offer much functionality. When picking a WordPress theme or framework as a parent theme, you should have a clear idea of what special function or style you want for your theme. Many people opt for a popular theme or framework but end up finding themselves overriding most of the code in the template files as header.php, page.php, function.php, and so on. If that is the case then they are better off breeding a stand-alone custom theme rather than a child theme.
Crafting a WordPress site from square one is no doubt much easier with a child theme as it sets you right up from a solid base to start with. You can also free yourself from the parent theme’s constraints and show your creativity by adding further functionality and style to make your theme become one of a kind. However, setting up a child theme is no easy task as it includes a mass of things to handle.
If you plan on making a child theme after this, don’t worry, we will give you a hand on this. Coming up next week is our follow up blog post on Child theme topic: a tutorial on how to create child theme for one of our WordPress themes. This upcoming blog post would give you a basic idea of creating child theme for any parent theme you want. So just bookmark our blog and stay tuned.