Blogging is about passion and love with the readers. To get readers attached to blog, the blog should be well designed. By well design I mean how user friendly my blog is.
I love to keep my blog neat and clean. But, it is really tough to see a blog as you want it to be. Because, it is hard for you to find a theme that will meet your demand totally.
So, a little theme customization is always necessary for any blogger. To customize a WordPress theme, child theme serves a great if you are not expert in dealing with the files in the theme folder. So, let’s learn some how to create a child theme.
What is child theme?
A child theme is a theme which inherits all the functions and css style from main theme, but any css style and functions can be changed or added to the theme using child theme without changing the main theme file.
What is the advantage of child theme?
Suppose, you have a theme installed in your blog. The theme looks fine but you want to change some style like font style, font size, background color or you just want to add some functions. But, you are afraid to change directly the style.css or functions.php as any error can happen any moment and you will lose all your settings.
But, with child theme you can change anything you like. If you do not like the change or make any mistake while editing and lost the code, you have nothing to worry about. Just delete the related file and you will get your previous theme settings.
How to create a child theme?
Now, we will learn how to create a child theme for WordPress blog or website.
Creating a child theme is very easy. Just follow the steps below:
- Log into your FTP or cpanel.
- Find theme folder for your blog from wp-content>>themes.
- Create a new folder here and give a name. This will be your child theme name. You can choose it anything you want.
- In the folder create a style.css file. This is must for creating child theme.
- Open the style.css file and write
/*
Theme Name: Your Child Theme Name
Description: Description for your child theme
Theme URI: http://example.com/
Author: Your name here
Author URI: http://example.com/about/
Template: Your main theme folder name
*/
@import url(“../Your main theme folder name/style.css”);
You can add your custom css code after above line.
Here, Theme Name, Template and @import url(“../Your main theme folder name/style.css”) is compulsory.
Now, look at the example below:
/*
Theme Name: Twentyeleven Child
Description: Child theme for the twentyeleven theme
Author: Himangshu
Template: twentyeleven
*/
@import url(“../twentyeleven/style.css”);
#site-title a {
color: #006400;
}
Today, I am going to stop here. Next day, we will learn how to add custom functions to a child theme.
{ 2 comments… read them below or add one }
Waiting to see easy post about how to edit chold themes. Actually i want to edit thesis.
very informative post