Your Uncommonly Amazing WordPress Tech Partner

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.
      createdir
    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:
      filesofchildtheme

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.
    activatetheme

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

You may also enjoy...

WordPress based membership sites have certain requirements, and make use of certain applications that, in my experience, makes most of the popular hosting providers a poor choice.
Head for Change was weeks from launching a plugin-heavy LearnDash site. A pre-launch audit cut plugins from 27 to 18 in 13 developer hours, and load testing caught that the

Google Analytics allows you to share access to your account with specific permission levels, making it easy to work with a team, freelancers, or partners. This feature helps you collaborate

MDBA’s purebred dog registry ran on an outdated Joomla site where every member registration was manual. We migrated to WordPress and MemberPress and turned days of back-and-forth into one guided

Leave a Reply

Your email address will not be published. Required fields are marked *