Editing a theme's files directly works, until the theme gets updated — every direct edit is silently overwritten. A child theme inherits everything from a parent theme while keeping customizations in a separate folder the update process never touches.
Just two files are required — a stylesheet declaring the relationship, and a functions file.
/* wp-content/themes/my-child-theme/style.css */
/*
Theme Name: My Child Theme
Template: wgh-starter
Version: 1.0
*/The Template: line — matching the parent theme's folder name exactly — is what makes it a child theme rather than a standalone one.
A child theme's own style.css replaces the parent's entirely by default — its CSS needs to be loaded explicitly, then the child's own rules enqueued after it to override anything needed.
// wp-content/themes/my-child-theme/functions.php
function wgh_child_enqueue_styles() {
wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css');
wp_enqueue_style('child-style', get_stylesheet_uri(), ['parent-style']);
}
add_action('wp_enqueue_scripts', 'wgh_child_enqueue_styles');| Function | Always points to |
|---|---|
| get_template_directory() | The parent theme's folder |
| get_stylesheet_directory() | The active theme's folder — the child theme, if one is active |
Placing a file with the exact same name and path in the child theme overrides just that one file — every other template still comes from the parent, unchanged.
my-child-theme/
├── style.css
├── functions.php
└── single.php ← only this template is overridden; page.php, index.php, etc. still load from the parentWhen to reach for one
A child theme is the standard, safe way to make any change to a theme not built for the site — including a purchased or downloaded theme whose updates need to keep working normally.