2 Ways to Create a WordPress Child Theme

Today I will show you two different ways create a WordPress child theme.


WordPress is a popular content management system that powers millions of websites worldwide. One of the best things about WordPress is its flexibility, customization options and ease of use. When it comes to customizing a WordPress theme, it can be challenging to make changes directly to your theme, without losing the ability to update it. But that’s where a child themes come in. I will shown you two different ways to Create a WordPress Child Theme.

Method 1: Create a WordPress Child Theme Manually

Creating a child theme manually is a straightforward process if you are familiar with coding. Here are the steps you need to follow, in order to make your own child theme.

Step 1: Creating Your Folder

Create a new folder in your WordPress themes directory (/wp-content/themes/) and name it after your parent theme, but with a -child in the end. F.e. if your theme is called twentytwentythree, then your child theme could be called twentytwentythree-child.

Step 2: The mandatory stylesheet

Create a new file named style.css in your child theme folder and add the following code:

/*
Theme Name:   twentytwentythree Child
Description:  Twenty Fifteen Child Theme
Template:     twentytwentythree
Text Domain:  twentytwentythree-child
*/

Theme Name and Template are the only required fields in the style.css file. The theme name can be anything you would like. Could be the name of the client or just Child theme. Template is the name of the folder your parent theme is located in.

Step 3: A default functions.php file

Create a new file named functions.php in your child theme folder and add the following code:

<?php
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles', 10 );
function my_theme_enqueue_styles() {
	$parenthandle = 'parent-style'; // This is 'twentytwentythree-style' for the Twenty Twentythree theme.
	$theme        = wp_get_theme();
	wp_enqueue_style( $parenthandle,
		get_template_directory_uri() . '/style.css',
		array(),  // If the parent theme code has a dependency, copy it to here.
		$theme->parent()->get( 'Version' )
	);
	wp_enqueue_style( 'child-style',
		get_stylesheet_uri(),
		array( $parenthandle ),
		$theme->get( 'Version' ) // This only works if you have Version defined in the style header.
	);
}

This code will enqueue the parent theme’s stylesheet and set up your own style.css for editing.

Step 4: Activating Your Child Theme

Go to the Appearance menu in the WordPress dashboard and select Themes. Activate your child theme and you’re done!

Method 2: Creating a Child Theme with a Plugin

If you’re not comfortable with manually creating a child theme, you can use a plugin to do it for you. Here are the steps you need to follow:

  1. Install and activate the Child Theme Configurator plugin.
  2. Go to the “Tools” menu and select “Child Themes.”
  3. Select the parent theme you want to use and click “Analyze.”
  4. Customize your child theme settings and click “Create New Child Theme.”
  5. Activate your child theme from the WordPress dashboard.

Using a Child Theme to Customize Your WordPress Theme

Now that you have created your child theme, you can use it to customize your WordPress theme without losing the ability to update it. Here are some examples of things you can do with a child theme:

  • Change the colors, fonts, and layout of your website.
  • Add custom functionality through the functions.php file .
  • Modify the header, footer, and other template files, by copying the file from the parent to the child folder, and start editing it.

You can make all the changes you want without affecting the parent theme. This means that you can update your parent theme without losing any of your customizations. Although it is a good idea to keep track of essential changes to the parent theme. If a security fix is applied to a file which you have overwritten, then you should make sure to update your file too.

Final notes

I hope you found my two ways to create a WordPress child theme helpful. Child themes are a great way to customize your website without losing the ability to update your theme. Whether you prefer to create a child theme manually or with a plugin, the process is straightforward and easy to follow.

So, go ahead and create your child theme today and start customizing your WordPress website!