⏲️ Estimated reading time: 2 min
Want to modify your WordPress theme safely? Learn how to create a custom child theme to preserve your changes during updates. This guide walks you through each step, from file creation to activation perfect for beginners and developers alike.
What Is a WordPress Child Theme?
A child theme in WordPress is a theme that inherits the functionality and styling of another theme, called the parent theme. It’s the safest way to make changes to your theme without losing them when updates roll out.
Step 1: Create a New Child Theme Folder
Using FTP or your hosting control panel, navigate to wp-content/themes/
and create a folder named after your new child theme. For example: twentytwentyfour-child
.

Step 2: Add style.css
Inside your child theme folder, create a file named style.css
. Add the following code:
/*
Theme Name: Twenty Twenty-Four Child
Template: twentytwentyfour
*/
@import url("../twentytwentyfour/style.css");
This sets up the child_theme to inherit styles from the parent.
Step 3: Add functions.php
Create a functions.php
file and add the following code to load the parent theme’s stylesheet:
<?php
function custom_child_theme_styles() {
wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css');
}
add_action('wp_enqueue_scripts', 'custom_child_theme_styles');
This is the correct way to enqueue styles in modern WordPress.
Step 4: Activate Your Child Theme
From your WordPress dashboard:
- Go to Appearance > Themes
- Click Activate under your new child_theme
Done! You can now safely add custom CSS, PHP functions, and even override template files.
Optional: Add a Screenshot
Add a screenshot.png
(1200x900px) to your child_theme folder to display an image in the theme selection panel.
Conclusion
Using a child_theme gives you total control over design and features without touching the core files of the parent theme. Whether you’re tweaking CSS or adding PHP, it’s the WordPress best practice for customizing safely.
🏷️ Tags: WordPress, child theme, create theme, functions.php, style.css, website customization, safe theme editing, web design, WordPress beginner, theme development
Only logged-in users can submit reports.
Discover more from HelpZone
Subscribe to get the latest posts sent to your email.