help with creating first child theme

Greetings! I am having trouble creating a child theme, I have never done it before. I asked in your support chat room and they said the following:
-------------------------------
Tyler Postleat 2:24 pm
Joseph, we can definitely provide a more detailed explanation on how to do it if you create a support ticket: https://premium.wpmudev.org/forums/#question

and we can setup your first child theme for you, which I think should help you get more comfortable with it :slight_smile:
-------------------------------
The reason I am trying to set up a child theme is because I received the following message from other development:

Oh, ok. You need to update to the latest version (2.7.4).
Before you do that you should create a child theme and move all your changes over because when you update, any change done to the theme files will be lost.

  • Adam Czajczyk

    Hello Joseph,

    I hope you're well today and thank you for your question!

    I assume that you made some changes to your theme, is that right? If so then indeed those changes would be lost upon theme update. In order to preserve them you would want to complete two steps:

    1. create a child theme
    2. "move" all changes made to the original (parent) theme to the child theme.

    I think though we could start with the first step first :slight_smile:

    I suggest taking a look at this articles before going any further:

    https://codex.wordpress.org/Child_Themes

    https://premium.wpmudev.org/blog/how-to-create-wordpress-child-theme/

    This resources should let you become familiar with basic rules and principles regarding parent/child WP themes and even help you create your first child theme. Let me though share a simple "step by step" guide on how to create your first basic child theme:

    1. access your server using an FTP program
    2. go to "/wp-content/themes" folder on the server
    3. create a new folder for your child theme:

    - let's assume that the theme that you're currently using is "Twenty Fifteen"
    - the theme is in a "twentyfifteen" folder in "/wp-content/themes"
    - so create the "twentyfifteen-child" folder in "/wp-content/themes"

    4. enter that new folder ("/wp-content/themes/twentyfifteen-child")
    5. create an empty file inside that folder, named "style.css"
    6. put the following code inside:

    /*
     Theme Name:   Twenty Fifteen Child
     Theme URI:    http://yourwebsite.com/twentyfourteen-child/
     Description:  My first child theme, based on Twenty Fifteen
     Author:       Your Name here
     Author URI:   http://yoursite.com
     Template:     twentyfifteen
     Version:      1.0.0
     Text Domain:  twenty-fifteen-child
    */

    and save the file

    7. create an empty file in the same folder, named "functions.php"
    8. put following code inside:

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

    and save the file.

    That's pretty much all, your very first child theme is ready. Please make sure however that you adjusted all the steps above to match the theme that you're currently using. I used Twenty Fifteen as an example but you may want to replace names of folders and "twenty fifteen" references inside code above with those matching current theme of your site.

    You should now be able to activate the child theme on your site via "Appearance -> Themes".

    As I mentioned before though, some additional work may be required to move all changes previously made to parent theme from parent theme to the child theme but let's get to this later once you got the child theme up and running :slight_smile:

    Would that help you or would you like me to setup such a basic child theme for you?

    Best regards,
    Adam

  • Predrag Dubajic

    Hi Joseph,

    There's actually child theme builder for Divi theme, I have used it to create one for you but if you wish you can create one yourself here:
    https://divi.space/divi-child-theme-builder/

    I'll attach the one I created below so you can unzip it and place it to your wp-content/themes/ folder and then simply activate it from your Themes panel from admin section.

    You can then move your changes to that child theme and update the parent theme.

    Let us know if you require some additional help with this :slight_smile:

    Best regards,
    Predrag

  • Adam Czajczyk

    Hello Joseph!

    We do not provide any migration/web development services. However, I may be able to help you if those changes you're referring to are not vary complex. I would however need to know first of what changes exactly are we talking about :slight_smile:

    Could you please elaborate a bit more on what would you like to achieve? Some screenshots in addition to the description would also be very helpful.

    Please advise!

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.