Your First Divi Child

Oct 13, 2025 | Customize

What’s a Child Theme — and Why Do I Need One?

If you have ever customized a Divi website only to have the changes vanish after an update, you’ll know why you need a child theme.

A child theme is essentially a log of changes from the original theme. When the theme gets updated, those changes then apply to the updated version.

Child themes are a WordPress feature, Divi merely abides by the WordPress standard. So, for any theme that may be updated, a child theme is a cautionary measure.

With the release of Divi 5, the framework has become leaner and faster, but the logic behind using a child theme has not changed. Let’s walk through what a child theme is, why you need one, and how to set one up the right way.

What’s a Child Theme?

A child theme is an extension to a WordPress theme that allows further customization of the theme after normal processing (after the theme has formatted it, but before it is displayed.)

Think of a child theme as a layer on top of Divi:

  • Divi (the parent) provides the foundation and all the features.
  • Your child theme adds or overrides specific styles, functions, or templates.

When Divi updates, your child theme stays untouched, but any direct changes to theme files are overwritten by updates.

Why Do I Need a Child Theme?

Even if you’re not a developer, there are several reasons to use a child theme:

  1. Preserve your work:
    Every update to Divi replaces its core files. Custom CSS, modified templates, or PHP edits inside the parent theme will be lost.
  2. Keep code organized:
    A child theme gives you a dedicated space for your tweaks — no digging through Divi’s core structure.
  3. Simplify troubleshooting:
    You can deactivate or adjust your child theme without affecting the main Divi framework.
  4. Extend functionality safely:
    If you want to enqueue scripts, register custom post types, or adjust hooks, a child theme lets you do that without breaking Divi’s update path.
  5. Future-proof your site:
    Divi 5 introduces a cleaner codebase and faster rendering, but maintaining separation between parent and child remains critical for long-term stability.

How to Create a Divi 5 Child Theme

The good news is, setting up a Divi child theme is straightforward — you only need a couple of files and a basic understanding of WordPress folders.

Step 1: Create a Folder

In your WordPress installation, go to:
/wp-content/themes/

Create a new folder, and name it with your child-theme name:
md ,y-divi-child

Step 2: Create a style.css File

Inside that folder, create a file named style.css.

Add the following header at the top:

/*
  Theme Name: Divi Child
  Theme URI: https://yourwebsite.com/
  Description: A custom Divi 5 child theme for extended functionality
  Author: Your Name
  Author URI: https://yourwebsite.com/
  Template: Divi
  Version: 1.0.0
  */

Below that, you can include your custom CSS rules. For now, leave it empty or add something simple to test:

body {
background-color: #f8f8f8;
}

Step 3: Create a functions.php File

Next, create a functions.php file in the same folder. This is where you’ll enqueue your child theme’s stylesheet (and optionally, custom scripts).

Paste the following:

<?php
function divi_child_enqueue_styles() {
  wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
  wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array('parent-style') );
}
add_action( 'wp_enqueue_scripts', 'divi_child_enqueue_styles' );

This ensures WordPress loads the Divi parent styles first, then your child styles.

Step 4: Activate Your Child Theme

Zip the my-divi-child folder (if uploading) or navigate to Appearance → Themes in your WordPress dashboard.
You should now see My Divi Child listed.
Click Activate, and your child theme is live.

All of your Divi settings, layouts, and designs will remain intact because Divi’s database-stored data isn’t theme-dependent.

Optional: Add a Screenshot

You can give your child theme a custom thumbnail by adding a file named screenshot.png
(1200×900px recommended) to the folder. WordPress will display it on your Themes page — a small but professional touch.

Directories

When linking to theme assets, be aware that the get_template_ family of functions will always point to the directory of the parent theme while the get_stylesheet_ family of functions will always point to the child theme’s directory.

<a href="#"><img src="<?php echo get_template_directory_uri() ?>/images/mypic.png" alt='My Picture'>Follow Me</a>
<a href="#"><img src="<?php echo get_stylesheet_directory_uri() ?>/images/mypic.png" alt='Another Picture'>Nice Pic</a>

In the example above the first link takes its image from the parent theme, the second from the child theme.

The upside to using get_stylesheet_directory_uri() is that child theme developers can use their own image by simply creating it in the proper location. On the other hand, if the image doesn’t exist in the child theme, it won’t show. The reason for this is that if a child theme is active the get_stylesheet_directory_uri() function doesn’t check (and doesn’t know) which file you are loading, so it won’t check for it, it will always resort to the child theme.

Best Practices for Working with a Divi Child Theme

  • Use it for persistent changes only. For quick CSS tweaks, Divi’s Theme Customizer or code module may be enough.
  • Keep your edits modular. If you experiment heavily, version-control your child theme (Git, Dropbox, or local backups).
  • Document your changes. Include comments in CSS and PHP — they’ll save you headaches later.
  • Test after Divi updates. Although your child theme protects your changes, you should still verify compatibility.

Final Thoughts

Creating a Divi 5 child theme is a simple yet essential step for anyone serious about building or maintaining a professional WordPress site.
It protects your work, keeps your customization clean, and ensures every Divi update enhances your site rather than erasing your progress.

Once you’ve got the structure set, you’ll find endless flexibility — from adding custom post types to writing your own modules.
Divi gives you the canvas; your child theme gives you the freedom to paint.