Appearance

Themes » Create a Child Theme

This feature is available on sites with the WordPress.com Business or eCommerce plan. If your site has one of our legacy plans, it is available on the Pro plan.

You can make many changes to your theme’s appearance using custom CSS and build upon its default functionality using plugins. If you’d like to go further and make changes to your theme’s underlying code, then you could consider creating a child theme.

Please note that this is an advanced option that requires knowledge of HTML and PHP.

Table of Contents

What is a Child Theme?

A child theme is a theme that inherits the functionality and styling of a parent theme.

To use an analogy from Kathryn Presner’s talk on Getting Comfortable with Child Themes: Think of a parent theme as a master recipe for brownies. You could create a child recipe called nutty brownies that inherits all of the ingredients and steps, but with the addition of nuts.

Below you’ll find screenshots of two themes in our repository, Bradford and Seedlet. Bradford is a child theme of Seedlet. You’ll see that Bradford inherits much of Seedlets’s design and has its own additional customizations:

↑ Table of Contents ↑

Create a Child Theme

To use child themes with a WordPress.com site, you’ll need to first install WordPress locally on your computer. After you’ve created your child theme locally, you can then zip it up and upload it to your WordPress.com plugin-enabled site.

An alternative to manually creating your child theme is to make use of a plugin that will create your child theme for you (for example Child Theme Configurator or Create Block Theme – each of which is explained later in this guide.) Search the plugin repository for “child themes” to browse through more options.

Please note: You can download a copy of free themes in our collection at the bottom of each WordPress.com showcase page. Look for the download link:

Download free themes

It is not possible to create a child theme of a theme that is already the child of another theme.

↑ Table of Contents ↑

Create a Child Theme Manually

For the example below, we’re going to be using the Twenty Seventeen theme.

  1. Search and download your theme file from the WordPress.org repository here. Once downloaded, double-click on a Mac, and that will extract the folder. Or if you’re on Windows, right-click and “Extract all.”
WordPress support creating a child theme manually step 1
  1. Create a new folder and give your child theme a name, for example, ‘twentyseventeen-child’.

It is recommended that the name of your child theme directory is appended with ‘-child’. Make sure that there are no spaces in your child theme directory name.

WordPress Support creating a child theme manually step 2
  1. Copy and paste the style.css and functions.php files from your original parent theme (twentyseventeen) into your new child theme (twentyseventeen-child).
WordPress Support creating a child theme manually step 3.1
WordPress Support creating a child theme manually step 3.2
  1. In your new child theme, open up your style.css file using a text editor, such as Notepad, Atom, Sublime Text, or any other text editor of your choice. Empty the file by clicking  command+A > delete on Mac (CTRL+A > delete on Windows).

Afterward, copy and paste the below lines of code:

Please note that the CSS code below may be theme-specific.

/*
Theme Name:   Twenty Seventeen Child
Theme URI:        http://example.com/twenty-seventeen-child/
Description:  Twenty Seventeen Theme
Author:           John Doe
Author URI:   http://example.com
Template:         twentyseventeen
Version:          1.0.0
License:          GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
Text Domain:  twentyseventeen
*/

You need to change the following lines to include the parent folder name to show that this particular theme will be its child.

– Theme name
– Description

You should keep the following fields as they are:

– Template 
– Text domain

The other fields are optional but not required. You can read more about what they are for here.

The template line should contain the folder name of your parent theme. Make sure to save this file after the changes have been made.

WordPress Support creating a child theme manually step 4
  1. In your new child theme, open up your functions.php file using the same text editor. Empty the file by clicking  command+A > delete on Mac (CTRL+A > delete on Windows).

Afterward, copy and paste the below code and replace the ‘$parent-style’ value with the name of your theme with a -style added (in this case it’s twentyseventeen-style).

Make sure to save this file after the changes have been made.

<?php
function my_theme_enqueue_styles() {
    $parent_style = 'twentyseventeen-style'; // This is 'parent-style' for the Twenty Seventeen theme.
    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 ),
        wp_get_theme()->get('Version')
    );
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
WordPress Support creating a child theme manually step 5

 

  1. Now we need to zip up the folders:

On Windows:

  1. Locate the file or folder that you want to zip.
  2. Press and hold (or right-click) the file or folder, select (or point to) Send to, and then select Compressed (zipped) folder.

A new zipped folder with the same name is created in the same location. To rename it, press and hold (or right-click) the folder, select Rename, and then type the new name.

On Mac:

  1. Locate the items to zip in the Mac Finder (file system)
  2. Right-click on a file, folder, or files you want to zip.
  3. Select “Compress Items”
  4. Find the newly created .zip archive in the same directory.
  1. You can now upload the .zip file of your custom theme by going to Appearance → Themes and clicking the Upload Theme button. Upload both your parent theme and your child theme and activate your child theme.

↑ Table of Contents ↑

Create a Child Theme Using the Create Block Theme Plugin

If you’re using a block editor theme, you can use the Create Block Theme plugin to create a new child theme with the currently active theme as the parent theme. This plugin makes it easier than ever to create a child theme right from within your site’s dashboard. Visit the Create Block Theme plugin to get started.

↑ Table of Contents ↑

Create a Child Theme Using Child Theme Configurator

Please note that Child Theme Configurator is a third-party plugin and support for this plugin can be found and submitted here: https://wordpress.org/support/plugin/child-theme-configurator/

To get started, install the Child Theme Configurator plugin.

  1. Once installed go to Tools > Child themes. Select a parent theme.
  1. Hit Analyze. This checks that the parent themes are using WordPress standard practice and that there’ll be no surprises with your theme.
Creating a child theme using Child Theme Configurator
  1. This is the name of the directory/folder that is housing the theme in your site.
  1. Select where you’re saving your styles. It’s recommended that you select the default primary stylesheet style.css option
Creating a child theme using Child Theme Configurator
  1. Select the parent theme stylesheet handling option, this determines how your child theme will use the styles of your parent theme. It’s recommended that you use the WordPress style queue option.
  1. Customize the child theme name, description, author and version. This where you enter in your themes credentials that will appear in your style sheet CSS.
Creating a child theme using Child Theme Configurator
  1. Copy parent theme menus, widgets and customizer settings. If you’ve been setting up your parent theme in the Customizer, this option will copy over those settings into your new child theme.
Creating a child theme using Child Theme Configurator

↑ Table of Contents ↑

Make Changes to Your Child Theme

We always recommend making changes to your theme away from your live site. Please see this guide on making changes locally.

↑ Table of Contents ↑

Support for Your Child Theme

The WordPress.com support team will be happy to help point you in the right direction or offer alternatives to a child theme (if they exist). More advanced HTML and PHP fall outside the scope of our support. If you require more advanced help, you could consider hiring a web designer or contacting your theme’s author directly.

Not quite what you're looking for?

Get Help