Note: If you are only using CSS customizations, having a child theme is not required and you can place your custom css code in Divi > Theme Options > General Tab > Custom CSS. If you plan on modifying theme template files (style.css or header.php) then you will need to create a child theme to retain those changes when updating. You can also find a great in depth guide from our blog here.  

There are two ways you can create a child theme:

  • Using a 3rd party plugin
  • Coding it from scratch

Using a 3rd party plugin - beginer

There are many 3rd party plugin in the WordPress Plugin Repos that you can use. Here are the top 3 choices:

Beside those three most used 3rd party plugins for creating a child theme there are many others that you can use. For more information browse this page: https://wordpress.org/plugins/search/child+theme/

Coding the child theme from scratch - intermediate

Coding a child theme from scratch is actually easier then it sounds. All we need is a code editor like Sublime Text or VS, or any other code editor will work.

On your local computer, create a new folder. Usually the name of the folder is Divichildtheme or Child theme for Divi. The name of the folder can be anything you want.

Inside the folder create the first file we need, which will be a .css file called style.css.

  1. In style.css place this code:
/*
Theme Name: Divi Child Theme
Theme URI: http://yourwebsite.com
Description: Child Theme For Divi
Author: Your Name
Author URI: http://yourwebsite.com
Template: Divi
*/
  • Theme Name: it's the child theme name, it can be anything you want, usually I use Divi child theme
  • Theme URI: it represents the author website, were the page URL where people can find out more about the child theme we are creatting
  • Description: a short description of your child theme, you can include things like: color scheme used, features added, etc
  • Author: Usually is your name, the person that have created the Child theme
  • Author URI: Could be your business website, or it can be the actual URL of the website where the child theme is used
  • Template: It is the parent theme name folder. Note: this name should be exactly as the folder name of the parent theme, if you have changed the Divi default folder to a different name, then that should be reflected in the Template option.

2. The second file that we will need is called functions.php and it will contain this PHP code:

<?php
/*================================================
#1 Load parent Styles
================================================*/
function dc_enqueue_styles() {
wp_enqueue_style( 'divi-parent', get_template_directory_uri() . '/style.css');
}
add_action( 'wp_enqueue_scripts', 'dc_enqueue_styles' );

That's all there is, at this point you will have a child theme for Divi.

Note: the same process can be applied for creating a child theme for Extra, the only difference is that in the style.css file the Template: Divi will be replaced with Template: Extra.

Did this answer your question?