WordPress is one of the most useful and popular blogging platform available today. WordPress uses themes for the design of the blog. We most often buy themes or use some free themes available in the market. There is one more way – Why not create your own WordPress themes. Trust me it’s not that difficult. WordPress themes are basically made of php, html and css. If you know these programming languages its great way to start.
What are child themes?
Child themes are the theme’s which uses the parent theme functions and has just one file which is the style-sheet file. In other word child theme exact copy of parent theme with different name, design and layout.
While creating WordPress theme we have two options:
- To create a child theme.
- To create WordPress themes from scratch.
Obviously the first option is great choice for beginners. To create child themes we just need to know css as all the php functions are taken care by parent themes.
How to create child theme?
Now suppose we have a theme name Rockingtheme. These theme is our parent theme and have all the theme files such as:
And many more files as per the functionality of theme. Now our child theme whose parent theme is Rockingtheme will have just one file:
All we need to do is put some information in style.css about the parent theme. Style.css file typically consists of the following code at the top. Apart from the topmost section copy all the style.css code into child theme.
Theme Name: rockingchild
Theme URI: http://example.com/
Description: Child theme for rockingtheme
Author: Your name here
Author URI: http://example.com/about/
Now when you go to WordPress dashboard there will be one more theme which is same as you child theme. When you activate the child theme the blog will still look the same as parent theme.
I hope you were successful in creating child themes for WordPress. If you have any problem please ask them in comments section. Thank you for reading this tutorial.