• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (inactive)
You are here: Home / Draft / Create WordPress Child Theme

Create WordPress Child Theme

Last updated on November 1, 2019 by Sal Ferrarello

You can quickly create a WordPress child theme by creating a new theme directory and adding these two files.

style.css

/*
 * Theme Name: My Child Theme
 * Template: twentynineteen
 */

Where the Template value is the directory name of the parent theme (in this case, we’re making a child theme of Twenty Nineteen, which is found in the twentynineteen directory).

functions.php

<?php
/**
 * Child theme functions.php
 *
 * @author Sal Ferrarello
 * @package salcode/childTheme
 */

add_action( 'wp_enqueue_scripts', 'fe_enqueue_parent_theme_style' );

/**
 * Enqueue parent theme style
 *
 * @author Sal Ferrarello
 */
function fe_enqueue_parent_theme_style() {
    wp_enqueue_style(
        'parent-theme-style',
        get_template_directory_uri() . '/style.css',
        array(), // Dependencies.
        '0.1.0', // Version.
        'all'    // Media.
    );
}

Official Child Theme Documentation

See the WordPress Official Child Theme Documentation

Sal Ferrarello
Sal Ferrarello (@salcode)
Sal is a PHP developer with a focus on the WordPress platform. He is a conference speaker with a background including Piano Player, Radio DJ, Magician/Juggler, Beach Photographer, and High School Math Teacher. Sal can be found professionally at WebDevStudios, where he works as a senior backend engineer.

Share this post:

Share on TwitterShare on FacebookShare on LinkedInShare on EmailShare on Reddit
Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Draft, Programming Tagged With: WordPress, WordPress Theme

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2023 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in