Overview

In this article you will learn how to easily create a Divi child theme and why it is important to have one.

Why is it important to have a child theme?

Have you ever done some edits to your Divi theme’s files and then lost them after an update? Well, most people have. Because when you update your theme, all old files are deleted and replaced by new default ones. So all your edits will be lost.
Luckily we can create a child theme, which will be the same as the original but will not be affected by an update.

So let’s create one!

Create a Divi child theme

    1. Open your website’s FTP or File Manager app.
    2. Go to your WordPress directory (it is usually inside public_html directory).
    3. Navigate to wp-content => themes.
    4. Create new directory inside themes directory and name it Divi Child Theme.
    5. Open the directory we just created.
    6. Right click and create new File and name it style.css (you must use this name or WordPress won’t recognize it).
    7. Right click on style.css and select Edit.
    8. Paste this code inside Editor:

      /*-------------------------------------------------------
      Theme Name: Divi Child Theme
      Theme URI: https://memberfix.rocks/divi-child-theme
      Description: A child theme template for Divi
      Author: MemberFix
      Author URI: https://memberfix.rocks
      Template: Divi
      Version: 1.0.0
      ----------------- ADDITIONAL CSS BELOW ------------------*/

    9. Save and exit.
    10. Create new file and name it functions.php (you must use this name or WordPress won’t recognize it).
    11. Right click on functions.php and select Edit.
    12. Paste this code inside:

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

    13. Now you’ll need an image, you can use any but WordPress recommends PNG file sized at 1200 by 900 pixels. And name it to screenshot.png. Or you can download this Image
    14. Upload it to your child theme’s direcotry.
    15. Your Child Theme directory should contain these files now:

Results

  1. Go to your WordPress Dashboard.
  2. Navigate to Appearance => Themes.
  3. You should see your new Child Theme now.
  4. Hover over your Child Theme and click Activate.

That’s it, now you can safely edit your theme’s files. Enjoy editing! 

Hi. My name is Dositej and I am a
Full Stack Web Developer,
Wordpress Developer,
Specialised in PHP back-end and web apps.
I’m also learning game development in my spare time.
I’m from Bosnia, a small but nice country.

Shares
Share This