If you customize WordPress themes then you should understand the basic concept of a WordPress child theme. Unfortunately, child themes can be confusing if you don’t have much experience with them. It’s important that you understand what a child theme is and how it works alongside a normal WordPress theme. It is always important to use a child theme instead of changing things in the main theme that you have purchased from ThemeForest as Authors like me 🙂 keeps on updating the theme on regular basis and updating the theme will surely override the changes you have had made.
To use a child theme, you install and activate it like any other theme. It will automatically inherit everything from its parent, and look exactly the same when you first activate it. You don’t need to worry about breaking your website when you activate a child theme.
Adding CSS to a child theme
The easiest way to customize your WordPress theme is with CSS, and a child theme makes that even easier. You can experiment with CSS in your child theme, and always revert back to the parent theme if you make a mistake.
You just have to put the css you need in the activated child theme style.css using your wordpress admin panel. Appearance > Editor . Notice you need to put your css below the @import of the parent theme stylesheet, this is important because you need to override the parent theme css properties by yours.
Save the style.css file and you should see the changes show up live on your site!
Changing template files in a child theme
First, find the template file in the parent theme that controls the view you want to change. Now copy that file to your child theme. Once that file exists in your child theme, it will be used instead of the original file in the parent theme. This is true of any file you copy to your child theme.
Now, you are ready to make changes to that particular file like you need. Habit of writing down the changed files will help you at the later stage when something goes wrong. If something really go wrong you can just delete the template from the child theme and website will start running from the parent theme template.