📑 Table of ContentsHide / Show
Why Child Themes Are Still Essential in 2026
When customizing theme styles, template files, or injecting PHP hooks, modifying parent theme files directly is a dangerous mistake. The moment the theme developer releases a security or feature update, all custom changes are permanently overwritten. A child theme inherits all parent functionality while isolating custom code in dedicated files.
Step 1: Create the Child Theme Folder
Navigate to /wp-content/themes/ via SFTP or your hosting File Manager and create a new directory. For example, if your parent theme is astra, name your folder astra-child.
Step 2: Create the style.css File
Inside your child theme directory, create style.css and include the required header declaration:
/*
Theme Name: Astra Child
Theme URI: https://wpustaad.com/
Description: Custom Astra Child Theme for WP Ustaad
Author: WP Ustaad Team
Author URI: https://wpustaad.com/
Template: astra
Version: 1.0.0
*/
Step 3: Enqueue Styles in functions.php
Create a functions.php file in your child directory and enqueue the parent stylesheet cleanly:
<?php
add_action( 'wp_enqueue_scripts', 'wpustaad_enqueue_child_styles' );
function wpustaad_enqueue_child_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style', get_stylesheet_uri(), array( 'parent-style' ), wp_get_theme()->get('Version') );
}
Step 4: Activate Your Child Theme
In your WordPress admin dashboard, navigate to Appearance → Themes. Locate your newly created child theme and click Activate. All custom CSS and PHP hooks added to the child directory will now safely persist forever.
⚡ Related WordPress Themes & Page Builders Guides
- Top 10 Full-Site Editing (FSE) Block Themes for WordPress – Ultra-fast Gutenberg native block themes that score 100 on PageSpeed.
- Astra vs GeneratePress vs Kadence Speed & Performance Showdown – Detailed benchmark of the three lightest multipurpose WordPress themes.
- How to Fix Elementor Stuck on Loading Screen & Editor Errors – Resolve memory limit bottlenecks, PHP safe mode, and conflicting plugins.
- LiteSpeed Cache Master Configuration for WordPress – Fine-tune page caching, guest mode, CSS minification, and Object Cache.
Proper Script Enqueuing & Template Part Overrides
Many legacy tutorials recommend importing parent styles using @import url("../parent-theme/style.css"); inside the child theme’s style.css file. In modern web performance engineering, @import is considered an obsolete anti-pattern because it blocks parallel CSS downloads and harms First Contentful Paint (FCP).
The standardized method is enqueuing stylesheets via wp_enqueue_scripts in your child theme’s functions.php with explicit parent-child dependency chaining:
add_action('wp_enqueue_scripts', function() {
// Enqueue parent stylesheet
wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css');
// Enqueue child stylesheet with parent dependency
wp_enqueue_style('child-style', get_stylesheet_uri(), array('parent-style'), wp_get_theme()->get('Version'));
});
When overriding template files (like header.php, footer.php, or WooCommerce template parts), replicate the exact directory subfolder structure in your child theme. WordPress will automatically load your child theme’s template in place of the parent’s.
Frequently Asked Questions
Will updating my parent theme overwrite modifications made in my child theme?
No. That is the fundamental purpose of a child theme: all custom CSS, PHP functions, and template overrides remain 100% safe when the parent theme receives an update.
Do I need a child theme if I only want to add a few lines of custom CSS?
No. For minor CSS styling tweaks (under 50 lines), utilizing the WordPress Theme Customizer’s Additional CSS panel or a site-wide CSS code snippet is cleaner and faster.
Can a child theme have its own custom screenshot and theme description?
Yes. Placing a 1200x900px screenshot.png image inside your child theme directory displays your custom branded preview inside the WordPress Appearance → Themes menu.

