📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials WordPress Development Child Themes

Child Themes

4 min read Quiz at the end
Child themes inherit parent and override specific templates — never modify parent theme directly.

Child Themes

# Never modify parent theme -- updates overwrite changes!
# Child theme inherits parent, override what you need

# 1. Create: wp-content/themes/my-theme-child/

# 2. style.css (required)
/*
Theme Name: My Theme Child
Template:   my-theme
Version:    1.0.0
*/

# 3. functions.php -- enqueue parent styles
add_action('wp_enqueue_scripts', function() {
    wp_enqueue_style(
        'parent-style',
        get_template_directory_uri() . '/style.css'
    );
});

# 4. Override templates
# Copy single.php from parent into child folder
# WordPress automatically uses child version

# 5. Override functions safely
if (!function_exists('parent_breadcrumbs')) {
    function parent_breadcrumbs() { /* your version */ }
}
Topic Quiz · 1 questions

Test your understanding before moving on

1. Which WP-CLI command replaces all URLs when migrating WordPress to a new domain?
💡 wp search-replace handles serialised PHP data correctly — plain sed/SQL breaks serialised strings.