Child Theme in WordPress is easy to make!
I have received many emails or questions from my readers about “What is a child theme?” and why should you use it or why shouldn’t you use it.
First of all, I will try to explain what a child theme is, in “newbie” language, because I am definitely not a theme developer, therefore, can’t really explain in a more techie language.
A child theme is actually another theme folder which a functionality to “redesign” or “re-make-up” a “parent theme” or the original theme that you want to modify, in order to make this “Parent theme” looks a bit or a lot different than it should.
According wordpress official page, it is stated;
Making a child theme is very simple. Create a directory, put a properly formatted style.css file in it, and you have a child theme!
As you noticed, it explains, as long as you have a style.css in this child theme folder, you already have a child theme.
If you want a video tutorial, I have posted a guide and a video tutorial on how to create Twenty Eleven child theme.
In this post, I will still use Twenty Eleven theme to be an example of a parent theme.
Or for more easy way to explain, I will embed the video of that tutorial again in this post so that you can watch it right here.
However here is also a video from wordpress tv that explains the difference between a child theme and a parent theme.
Should I use a child theme?
I would say, it depends on the theme you are currently using.
If you for example, use a theme where it is not updated frequently, and you are “satisfied” enough with the appearance, then I don’t see a reason why you should create a child theme.
However if you feel like you want to redesign the color, or logo or anything, and this theme is frequently updated, then I would strongly recommend you create a child theme.
Other than that, if you want to keep the “original” theme “clean” without your codes inside, then it is also best to create a child theme.
Creating a child theme is very easy and simple, as mentioned above, only with style.css
Where is this child theme should be located?
As many other themes, this “child” theme folder must be created inside “themes” folder.
As you know, when you install wordpress, you should have many files and folders, such as wp-admin folder, wp-content, and lastly, inside wp-content, you have plugins and themes. Inside “themes” folder, you create a child theme folder. (see below screenshot, red highlighted is the child theme, and the blue highlighted is the parent theme.)
Like wordpress page’s explanation, you can have only a style.css but you can also add any folders you like, for rotating header for example, or functions.php and images folder. But generally, it will load “functionality” of the parent theme or original theme.
As in the video above, I named my child theme as “MyTwentyEleven”. About this name, you can name it whatever you wish.
Let’s take a look with Twenty Eleven theme.
Inside MyTwentyEleven, as long as you create a style.css file, you will have a theme.
Then, if you let this style.css empty, it will bring much, except with the white background and unstyled site.
To call the “parent time” style you need to add a few lines with “template: parent theme” line included.
Basically, with Twenty Eleven, you need to add these codes to call the functionality and the parent theme’s style:
/*
Theme Name: MyTwentyEleven
Theme URI: Your URL
Description: My own Twenty Eleven copy
Author: Your name
Template: twentyeleven
*/
@import url('../twentyeleven/style.css');
By using a child theme, your own customization codes will be loaded from your server once, and then from now on, it will be saved in the user’s browser, so it won’t load from your server again, unless the cache is cleaned.
Also, since the theme is frequently updated, your customizations will stay, and won’t affect the style you implemented to redesign the parent theme.
I thought this was another great way to explain child themes from the Child Theme Store…
Child themes always require a parent theme – the child’s particular parent theme, to be installed in order to function. It is important to understand this concept clearly. This means that if you don’t already have the parent theme and want to use the child theme, you may also need to purchase the parent theme. The two are very separate but work together. Just remember that every child needs a parent. You might be wondering why on earth would you want to use both a child and a parent theme?
According to the WordPress codex (codex is just a fancy way of saying, the documentation area), a child theme is a theme that inherits the functionality of another theme, called the parent theme, and allows you to modify, or add to, the functionality of that parent theme. So, what exactly does that mean? It means that you can keep your sites more secure, intact and easily be able to upgrade your core, base or framework theme (the parent) when the improvements and changes occur and NOT have to worry about overwriting the tweaks you had made to the style (the child) to get your site looking just the way you wanted it.
Using a child and a parent theme sounds much more complicated than it actually is. It is really easy and can all be done right in your WordPress dashboard. First, install the parent theme. You don’t even need to activate it. Then, install and activate your child theme. That is it. We told you it was easy. childthemestore.com
ohhhhhhhh
thanx for great contents with so simplification!
Hi Kimi,
I’ve installed WordPress few weeks ago, made some modifications on the design Twenty Eleven template, but along the way I’ve been hearing that I need to make a “Child Theme” first before modifying anything.
Can I still make a child theme now that I’m halfway on modifications? If I make a child theme will my modifications be gone and have to start everything from the scratch?
I appreciate what you are doing here…very nice of you…Thank you very much…
Hi
Yes, you should make a child theme before modifying, all the modification you have made will be gone once the theme is updated by wordpress.
Hope this helps.
Kimi.
Kimi please help me out,
I’m already halfway done in modofying the looks of my website, but it’s not a child theme. If I make a child theme at this point will my modifications disappear and start over again?
Thank you so much…