How to Create a WordPress Child Theme? Know the Steps

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.

How to Create a WordPress Child Theme? Know the Steps

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.

/*
Theme Name:Twenty Fourteen Child
Theme URI: http://example.com/themes/twentyfourteen
Description:Twenty Fourteen Child Theme
Author:the WordPress team
Author URI:http://wordpress.org/
Template:twentyfourteen
Version:1.0
*/
@import url("../twentyfourteen/style.css");

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.

How to Create a WordPress Child Theme? Know the Steps

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.

/*
Theme Name:Twenty Fourteen Child
Theme URI: http://example.com/themes/twentyfourteen
Description:Twenty Fourteen Child Theme
Author:the WordPress team
Author URI:http://wordpress.org/
Template:twentyfourteen
Version:1.0
*/
@import url("../twentyfourteen/style.css"); /* Theme customization starts here -------------------------------------------------------------- */

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.

Rupesh Hingu
Rupesh Hingu

I’m Rupesh Hingu🚀, the founder and curator of ModernWPThemes.com. With a passion for WordPress that runs deep, I’ve dedicated this platform to helping you navigate the ever-evolving world of WordPress. Connect with me on LinkedIn, follow me on Twitter or Facebook.

Articles: 95

2 Comments

  1. This is very helpful. One question: if I want to add one php file, should I put it in the child theme folder or in the parent theme folder?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.