
How to Create WordPress Child Theme
- March 8, 2016
- Leave a comment
To extend the functionality of a parent theme in WordPress, a Child Theme (also known as a secondary theme) is created. Since you can activate only one theme at a time it becomes tricky to extend the functionality of your website. For this, you can update/edit your Parent theme. However, once it is updated, all your custom modifications will be lost. But there are other ways from which you can extend/modify the functionality of your WordPress website such as:
- Plugins – If you want to add a new module or to achieve back-end related functionality (not related to site front end design), you can configure/activate a plugin for it
- Child Themes – You can create child theme of any Parent theme. The child theme will use 100% functionality of its parent theme while letting you can add/modify the parent theme design, etc. It also provide speedy development according to the WP standards
Steps for creating a Child Theme:
Let’s say you want to create a child theme for your theme named “PT WordPress Theme???
- Go to the WordPress theme folder from FTP/File Manager, and check the name of your activated theme. In our case, “ptWordPressTheme??? is the theme folder name
- Once you have decided on your parent theme (which is already activated) you can create a child theme for “PT WordPress Theme??? and modify this theme’s front-end design
- Create a new folder in the WordPress theme folder; in this case we created “ptWordPressTheme-child??? as the folder name
- Your child theme folder should contain at least the following two files:
a) style.css
b) functions.php
If the “ptWordPressTheme-child??? folder does not contain these files you can create them, for example, as style.css and functions.php - Now its time to add some code in these files – begin with style.css:
a) Open style.css file. Add the following code and modify it according to your requirements:
1234567891011/*Theme Name: PT WrodPress Theme ChildTheme URI: #Description: Child ThemeAuthor: PressTigersAuthor URI: https://www.presstigers.com/Template: ptWordPressThemeVersion: 1.0.0License: GNU General Public License v2 or laterLicense URI: http://www.gnu.org/licenses/gpl-2.0.html*/
b) Here, note the template value. Ideally it should be your parent theme folder name, in order to use its functionality in the child theme
c) Now open functions.php file. Add the following code and modify it according to your requirements:
<pre”>This code will add the parent style in your theme
- Now you can add a new CSS or override the parent CSS in your child theme’s style.css file
- In the same way, you can override the parent template
- Don’t forget to activate your child theme – and you are done!

User Comments