And Why You Should Use One (All The Time)
Creating a child theme can be one of the most boring and time consuming processes when setting up a website, but it can also be one of the most valuable things you ever do when building a wordpress site. In the rush of building a new website it is sometimes hard to stop and make myself create a child theme, but going forward I am going to commit myself to taking the time to do this little act that will save me time and money in the future.
In this post I am going to walk you through creating a child theme as if you had no idea what you are doing. This post may seem low level to some of you who know what is going on, but this walk though is more geared towards beginners.
What is a child theme?
A child theme is a group of files that imports your parent theme files. It is actually a very simple set of files that you can create. Everything from the frame work to the styling comes from your parent theme. It is pulled through your child theme, which acts as a filter or sponge of sorts to make changes that you would like to remain in effect forever. If you make a change in the files of your theme and you update your theme then the changes you have made will be over written. By creating a child theme you will ensure that even when changes are made to your parent theme, your changes and edits will remain safe and in effect.
How do I create a child theme?
Creating a child theme is very easy. You need to create a folder and name it “theme name”-child. You can replace the theme name words with your actual theme name and also remove the ” ” so that your folder name looks like this: themename-child. Once you have the folder created you just need to add one file to it. The file you need to add is a style.css file. Within the style.css file you need to add the following code:
Theme Name: Theme Name Child
Theme URI: websitesbyryan.com
Description: Theme Name Child
Author URI: websitesbyryan.com
Template: Theme Name
/* =Theme customization starts here
Once you have created this file in a text editor like notepad, you then need to save it with a file name of style.css and change the file type to all files before saving. Afer creating your style.css file you need to place it in your folder and zip the folder and upload it to wordpress as if it was a theme. Once you do this you should see a new theme in your themes section and you will be able to activate it. If done correctly nothing on your site should change. If you are having trouble following these steps you can always do it the easy way.
The Easy Way (The answers are always in the back of the book, right?)
Alright, so if you are having trouble, or like me you just prefer doing things the easier and more efficient way, you can download and install the The One Click Child Theme Plugin. This plugin will create a child theme with the click of a button. Once created all you will need to do is go activate it in the themes section of your website.