Ever heard about WordPress Child Theme?
If you’re a blogger or web developer who makes use of WordPress platform for making blog or website, then you must definitely know the steps to follow for making WordPress Child Theme. Most of us try to do some modifications in the main theme for making our website look the best, but sometimes small mistakes may totally waste our hard work. Many times the parent theme may stop working properly due to mistakes done while doing the modifications.
By creating WordPress Child Theme you can get rid of tension of making any wrong changes in the parent theme. You can do all the customizations that you want in the child theme, as the parent theme won’t get affected. Many pro bloggers do all the customizations and modifications in WordPress Child Theme only as they don’t want the parent theme to get affected.
Here are the steps for creating WordPress Child Theme:-
1> Make a New Folder
Firstly you should make a new folder for the Child theme that you want to create. You need to go to
‘/wp-content/themes/’ for creating the folder for the WordPress Child theme. If your parent theme name is twentyfourteen, then you can name the child theme as /twentyfourteen-child/. Creating a new child theme folder is important as you’ll be making modifications to the files included in this folder.
2> Create style.css file
After making the new child theme folder, you need to create a style.css file. You need to add the below mentioned info in the style.css file.
Most important parts of the style.css file are ‘Template’ and ‘@import url’. It is necessary that you make sure that the right Template name is shown and it is directed properly to the parent theme. ‘@import url’ is important as it imports the original style.css from the parent theme.
3> Activate Your WordPress Child Theme
Once you have created the folder for child theme and added the style.css file, then you can activate your child theme very easily. You need to go to ‘Appearance > Themes’ page for activating the child theme. Uploading the parent theme is very necessary, as without it the child theme may not work.
Modify WordPress Child’s Theme style.css
The main advantage that you get after creating WordPress Child Theme is that you can very easily modify the child theme’s style.css without affecting the parent theme. All the changes which you need to make to the newly created child theme can be done by adding CSS information below the ‘@import url’ line. Your child theme’s CSS will always overwrite the parent theme CSS which is definitely a reason making people create WordPress Child Theme. You can do all the modifications as you want in the Child Theme, as if it stops working you have the option to create another WordPress Child Theme.
Add Custom Functions to Child Theme
You can not only change the style.css of child theme according to your own wish, but also add some amazing custom functions. WordPress Child Theme always comes with the functions of the original parent theme. The special feature is that if you can add special functions in the Child Theme by creating a ‘Functions.php’ file.
|<?php // add your PHP functions here ?>|
After reading this article you must have definitely understood that creating a WordPress Child Theme is not a difficult task. If you’re someone who really likes to do many modifications in the CSS and functions of the original theme, then creating WordPress Child theme may be the perfect option for you.