Script to quickly create a Divi child theme
A best practice in WordPress is to never modify a third-party theme directly. Instead any modification you need to make should be done inside of a child theme.
The same applies when using Divi (affiliate link).
Here is a quick bash script that will simplify this process.
Note: The commands and theme images are from here.
I used the WordPress droplet from Digital Ocean (affiliate link) to test this script so you may need to adjust the script depending on where your site’s web root is located.
#!/bin/bash cd /home/becauseiforgetthings/htdocs/becauseiforgetthings.com/wp-content/themes mkdir divi-child cd divi-child cat <<EOT > style.css /* Theme Name: Divi Child Theme URI: https://www.elegantthemes.com/gallery/divi/ Description: Divi Child Theme Author: Elegant Themes Author URI: https://www.elegantthemes.com Template: Divi Version: 1.0.0 */ EOT cat <<EOT > funcitons.php <?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' ); EOT wget https://www.elegantthemes.com/blog/wp-content/uploads/2018/02/screenshot-copy.png mv screenshot-copy.png screenshot.png cd