How to create wordpress child theme?

child theme

Create wordpress child theme

If you want your wordpress website to be upgrade safe, it is always best practice to create a child theme and then do the modifications. Child theme inherits all features from the parent theme.

You can build custom theme by creating a child theme and your changes are not overwritten or your customizations are not lost when there is a theme version upgrade available.

Here are steps to set up a wordpress child theme:

Create child theme folder

Create a folder in wp-content/theme with the themename-child

child theme



Create a style sheet

File  style.css will have code as below. Keep the Template name same as your Parent theme. In this file you can write your css code and customise your parent theme

Theme Name: Twenty Fifteen Child
Theme URI:
Twenty Fifteen Child Theme
Author: Manjeet Kaur
Author URI:
Template: twentyfifteen
Version: 1.0.0
Text Domain: twenty-fifteen-child

Now Activate your child theme.

Go to Apprearnce and Activate your child theme.

Create functions.php

add_action( ‘wp_enqueue_scripts’, ‘my_theme_enqueue_styles’ );
function my_theme_enqueue_styles() {

$parent_style = ‘parent-style’;

wp_enqueue_style( $parent_style, get_template_directory_uri() . ‘/style.css’ );
wp_enqueue_style( ‘child-style’,
get_stylesheet_directory_uri() . ‘/style.css’,
array( $parent_style ),


Now you can start writing your own css code in the style.css and php code in functions.php

Feel free to comment below if you have any questions.