A child theme allows you to modify a WordPress theme's features or appearance without affecting the original theme's core files. This ensures that your customizations remain intact when the parent theme is updated.
Before you begin
You will need:
Site Administrator access to your WordPress dashboard.
Access to a file manager (such as the one provided in your hosting control panel) or an FTP/SFTP client.
A clear understanding of which parent theme you intend to customize.
Create the child theme folder
Log in to your hosting control panel and open the File Manager.
Navigate to the directory where your WordPress themes are located (typically
public_html/wp-content/themes/).Create a new folder for your child theme.
Name the folder using a descriptive name, such as
parent-theme-child.
Create the child theme files
Inside your new child theme folder, create a new file named
style.css.Open
style.cssand add the following information, replacing the placeholders with your specific details:
/* Theme Name: Parent Theme Child Template: parent-theme Author: Your Name Description: A child theme for the Parent Theme. Version: 1.0.0 */
Create a second file in the same folder named
functions.php.Open
functions.phpand add the following line to ensure the parent theme's styles are loaded:
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );
function enqueue_parent_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
Activate the child theme
Log in to your WordPress dashboard.
Navigate to Appearance > Themes.
Locate your new child theme in the list.
Click Activate.
Confirm the result
The site should load using the child theme.
You can verify this by navigating to Appearance > Themes; the active theme should display as your child theme.
Any changes made to the
style.cssorfunctions.phpfiles in the child theme folder will now be reflected on the site without affecting the parent theme.
What this does not mean
Creating a child theme does not automatically copy the content or settings of the parent theme. It only inherits the functionality of the parent theme. If you need to add specific features or unique styles, you must do so within the child theme's files.
