How to create a child theme ?

The Child Theme is used to ensure that your modifications are preserved and your changes made won’t overwritten by updates of the theme.
If you need more information please read here the official documentation here or follow these steps to create the child theme.

1. How to create a Child theme directory

The first step in creating a child theme is to create the child theme directory folder in wp-content/themes.
It is recommended that the name of your child theme directory is appended with -child and that there are no spaces in your child theme directory name. The child theme name will be for example:


2. Create the Stylesheet – Style.css

Now you have to create the child theme’s stylesheet (style.css). The stylesheet must begin with the following details about the Theme in the form of comments. (stylesheet header)
Here an example of the Ong Child theme style:

Theme Name: Ong Child
Theme URI:
Description: Wonderful theme for your Business.
Author: Nicdark
Author URI:
Template: ong
Version: 1.0
License URI:
Tags: one-column, two-columns, right-sidebar, custom-header, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, translation-ready, accessibility-ready
Text Domain: ong-child

The only required child theme file is style.css, but functions.php is necessary to enqueue styles correctly, check the next step.

3. Create the functions.php

The first line of your child theme’s functions.php will be an opening PHP tag <?php , after which you can enqueue your parent theme stylesheet.
In Ong Child theme for example you will have :

add_action( 'wp_enqueue_scripts', 'enqueue_parent_theme_style' );
function enqueue_parent_theme_style() {
 wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );

4. Activate the child theme

Your child theme is now ready for activation. Log in to your site’s administration panel, and go to Administration Panels > Appearance > Themes. You should see your child theme listed and ready for activation.

Categories :

Can't find what you're looking for ? Ask our support team.

© Nicdark Agency