Search for the Article

How to Create a WordPress Child Theme Manually - Step by Step

Step 1: Create a new folder for your child theme. The folder name should be the same as the theme name, but with -child appended to it. For example, if your theme is named twentytwentyone, your child theme folder should be named twentytwentyone-child.
 

wp-content- theme - Your child theme folder name


Step 2: In the folder you just created for your child theme, create a new file called "style.css" in a text editor. Then, add the following code to the top of the file:
     
/*
Theme Name: Your Child Theme Name
Theme URI: https://example.com/your-child-theme/
Description: This is a child theme of the Twenty Twenty One theme.
Author: Your Name
Author URI: https://example.com/
Version: 1.0.0
*/

          
This code tells WordPress that your child theme is a child of the Twenty Twenty One theme. You can change the values of the Theme Name, Theme URI, Description, Author, Author URI, and Version properties to match your own preferences.
Once you have added the code to the top of the style.css file, you can save the file and close the text editor. Your child theme is now ready to be used!
Step 3: Create a file with name fucntion.php and include the following code into this file and upload it on child theme folder
     
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );
function enqueue_parent_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
}