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.

Introduction In this article, you’ll learn how to automatically add new members to different spaces in your Circle community based on the membership they have paid for. With this, you

Our review is based on actual, real world experience “in the trenches” using and working with this plugin for over 5 years!

No official Google Maps location? No problem! Do you want to show Google Maps pins on custom places that aren’t “official” locations on a Google Map? No problem, in this

Leave a Reply

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