In this article, we look at how to create a child theme for your WordPress website and why you would be better off with one.
What is a child theme?
A child theme is a replica of a theme. It takes on all the functions of the parent theme and on top of that, allows you to customize it further without affecting the core functions of the parent theme.
Is there a reason for having a child theme?
The answer is yes if you are planning to add in extra coding (HTML, css) to enhance the functions of your website. However, WordPress is constantly updating to improve its security and so are the themes you are using. Theme creators upload updates for their themes on a regular basis to match the upgrades for WordPress. As a result of these theme updates, whatever customization you might have created on your existing theme would be over-ridden bringing you back to square one.
The only exception for not using a child theme is when you are absolutely sure you would only be using whatever functions the theme provides. In other words, you are not planning to make any major tweaks such as overhauling the theme’s functions.php and style.css files.
How to create a child theme?
Now that we understand what a child theme is and why it is so important to have one, let’s explore the various ways of creating one.
As with WordPress, there is always a plugin for every function under the sun. Such is the case for creating child themes as well. As it happens, the easiest way for me is to use a plugin known as Childify Me. Using this plugin, you can basically create a child theme from any parent theme. However, it is probably a good reminder that not all parent theme provides good framework for creating child themes.
What do I mean by that?
For example, if the parent theme offers very limited functions and you find yourself almost having to code in almost every new function, then this is not a good framework for a child theme. You are probably better off creating a new theme from scratch or look for another parent theme that comes with most of the desired functions.
For those who are more techie, you are probably familiar with the use of FTP. Traditionally, FTP was how websites were created and updated. But gone are those days and in place of FTP, the WordPress Dashboard offers a user-friendly GUI where you can manage your entire site’s contents with ease. Anyone can do it and that’s the beauty of it – it frees you to focus on what matters most – your content.
Anyway, for those looking to use FTP to create a child theme, you can use a free FTP tool like FileZilla and have it connect to your WordPress theme directory. From there, create a new folder and name it after the parent theme. For example, if the parent theme is twentyfifteen, then you can create a folder and title it “twentyfifteen-child”. This naming system is not fixed, you can name it anything but what’s important is the style.css file you will create within this new folder.
Within the style.css file, you have to ensure the Template is pointing to the correct theme name. It is all in lowercase, so if you write it as TwentyFifteen (Wrong) instead of twentyfifteen (Correct), it is going to result in an error.
Theme Name: Twenty Fifteen Child
Theme URI: http://example.com/twenty-fifteen-child/
Description: Twenty Fifteen Child Theme
Author: John Doe
Author URI: http://example.com
Template: twentyfifteen <—- THIS IS VERY IMPORTANT, MAKE SURE IT’S ALL IN lowercase!
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.HTML
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
Text Domain: twenty-fifteen-child
Essentially, both Childify Me plugin and FTP work for all parent themes. The only difference is that with Childify Me, it’s all done at the backend saving you from fiddling with your site directories and deleting folders by mistake. If you like to learn how to use FileZilla to create your child theme, here’s a video.
As you can see, creating a child theme via FTP has its own merits. Essentially, you just need to create the child theme folder and add in the necessary files – style.css and functions.php. And if you like to customize the header of the theme, you just need to copy and paste the header.php file into the child theme folder and adjust the necessary code. It’s not that hard once you get the hang of it.
Lastly, some themes also provide their own child themes directly. A classic example is the Genesis theme. The Geneis theme comes with a full-featured framework that makes it a popular choice for child theme. In fact, I should say if you are using the Genesis theme, you should use a child theme. This way, you won’t have the risk and headache of having all your customization gone to waste.
Genesis is one of the best WP theme frameworks out on the internet and just in case you are worried about your site looking identical to everyone else, Genesis’ child theme comes in many variations to suit your niche. To add a touch of your originality, you will be at ease knowing that you can customize your child theme until it fits your palete.
Due to the popularity of Genesis framework, there are many child themes available to choose from or if you feel adventurous, you can also just customise right off from the Genesis framework itself.
I hope this gives you a clear idea of what a child theme is and the why and when you should consider using one. Given that any respectable theme is constantly being updated, it would be in your interest to start with a child theme instead of working directly on the parent theme. In addition, if you like to start off with the Genesis framework, I have included here a direct link. This is my affiliate link and if you make a purchase, I make a commission at no extra cost to you.