• Website Home
  • About
  • Services
  • Portfolio
    • Recent
    • Archives
  • Shop
    • Catalog
    • Order

ASK Design Blog

Designer | Artist | Teacher

  •  
    • Blog Home
    • Web Design
    • Graphic Design
    • Art
      • Licensed Art
    • Links
    • Calendar
    • Contact
      • Privacy Policy
      • Cookie Policy

    Why and How You Create WordPress Child Themes

    November 5, 2019 by ProfK 3 Comments

    Why You Create Child Themes

    Child themes are customized versions of an original (“parent”) theme. If you make changes to the parent theme directly, you risk losing those changes whenever the theme is updated. The key benefit of a child theme is that you retain all of your customizations when the parent theme is updated. I usually create the child theme myself, but there are plugins that will do it for you. Furthermore, if you’re using a framework like Genesis, you use child themes in addition to the “parent” Genesis theme.

    How to Create Child Themes – General

    A child theme consists of at least one directory (the child theme directory) and two files (style.css and functions.php), which you will need to create:

    • the child theme directory
    • style.css
    • functions.php

    For full details, read the WordPress.org explanation:
    https://developer.wordpress.org/themes/advanced-topics/child-themes

    WP.org child themes explanation
    Step 1 – Create a child theme directory (folder) inside wp-content/themes

    Append directory name with “-child”. For example:
    Parent theme directory = “TwentyNineteen”
    Child theme directory = “TwentyNineteen-child”

    OR

    Step 1 Alternative – Append directory name with “-clientname”

    This is a good strategy when creating multiple child themes for the same parent theme. For example:
    “TwentyNineteen-clientname”

    Step 2 – Create a copy of the parent theme style.css file

    Then, change the name of the copy to: “style-TwentyNineteen-original.css”

    Step 3 – Edit child theme’s stylesheet file (style.css)

    The style.css file must begin with the following header:

    /* 
     Theme Name: Twenty Nineteen Child 
     Theme URI: https://example.com/twenty-nineteen-child/ 
     Description: Twenty Nineteen Child Theme 
     Author: Anne Katzeff 
     Author URI: https://www.askdesign.biz  
     Template: twentynineteen 
     Version: 1.3
     License: GNU General Public License v2 or later 
     License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     Tags: one-column, flexible-header, accessibility-ready, custom-colors, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, rtl-language-support, sticky-post, threaded-comments, translation-ready
     Text Domain: twentynineteen-child 
     */

    Required information:

    • Theme Name – must be unique and different from the parent theme.
    • The following information should be based on the child theme:
      • Theme URI
      • Description
      • Author
      • Author URI
      • Text Domain
    • Keep the following information the same as the parent theme:
      • Template – must be the name of the parent theme directory
      • Version
      • License
      • License URI
      • Tags
    Step 4 – Continue editing child theme’s stylesheet file (style.css)

    Delete everything underneath the header. Therefore, this stylesheet will only contain your modifications.

    Step 5 – Depending on the theme, either import parent style sheet into style.css or add enqueue to functions.php
    • OPTION #1 – Import parent style sheet into child theme style.css:
      @import url(“../suffusion/style.css”);
      @import url(“../suffusion/skins/light-theme-royal-blue/skin.css”);
      /*— add overrides below —*/

    OR

    • OPTION #2 (The recommended method) – Add enqueue to child theme functions.php file:
    <?php
    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    function my_theme_enqueue_styles() {
     
        $parent_style = 'parent-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.
     
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array( $parent_style ),
            wp_get_theme()->get('Version')
        );
    }
    Step 6 – Upload BOTH parent and child themes to your WordPress site
    Step 7 – Activate the child theme

    After activation, you may need to resave your menus and theme options.

    Use a Plugin

    Sometimes you may encounter problems in creating a child theme manually. I had such an issue recently. For a new client, I inherited a site that uses a multi-purpose, page-builder theme. The previous developer customized the theme by modifying the style.css directly, without the use of a custom style file, WP customizer, or child theme. Any theme updates would have eliminated all of the customizations!

    I attempted to build a child theme myself. But, there are so many templates and CSS files that my attempts were unsuccessful. Along came the Child Theme Configurator plugin to the rescue! It analyzes the parent theme, then you select the options you need. Within a minute or 2, voila! You have a child theme that works perfectly. I highly recommend this plugin:
    https://wordpress.org/plugins/child-theme-configurator/

    How to Create Child Themes – Genesis Framework

    These steps are a little different since Genesis is a framework that uses child themes.

    Step 1 – The same as for General child themes

    Create a child theme directory (folder) inside wp-content/themes.
    Append directory name with “-child” OR with “-clientname”. For example:
    Parent theme directory = “TwentyNineteen”
    Child theme directory = “TwentyNineteen-child” OR “TwentyNineteen-clientname”

    Step 2 – The same as for General child themes

    Create a copy of the parent theme style.css file.
    Change name of copy to: “style-TwentyNineteen-original.css”.

    Step 3 – Edit child theme’s stylesheet file header area (style.css) to have your information
    /*
    	Theme Name: Digital Pro PEK
    	Theme URI: http://my.studiopress.com/themes/digital/
    	Description: Customized theme for Paul E. Katzeff, based on Digital Pro.
    	Author: Anne S. Katzeff
    	Author URI: https://www.askdesign.biz/
    	Version: 1.1.2
    	Tags: one-column, two-columns, left-sidebar, right-sidebar, custom-colors, custom-header, custom-menu,  e-commerce, featured-images, flexible-header, full-width-template, sticky-post, theme-options, threaded-comments, translation-ready, accessibility-ready
    	Template: genesis
    	Template Version: 2.2
    	License: GPL-2.0+
    	License URI: http://www.opensource.org/licenses/gpl-license.php
    	Text Domain: digital-pro
    */
    
    Step 4 – Add your customizations in one of the following ways:
    • Use the theme’s customizer :
      Appearance > Customize > Additional CSS.
    • Add to the bottom of the stylesheet, before the media queries.
    • Edit the stylesheet directly.
    Step 5 – Upload BOTH Genesis Framework and the child theme to your WordPress site
    Step 6 – Activate the child theme

    After activation, you may need to resave your menus and theme options.

    Sources

    • https://www.studiopress.com/
    • https://wordpress.org
    • https://www.w3schools.com
    • http://www.htmldog.com/
    • Genesis Child Theme Development: How to Make it Yours by Carrie Dils http://ow.ly/N0N6304Rwg5

    Related Posts

    How to Choose a WordPress Theme
    My Core Set of WordPress Plugins
    WordPress Pages vs. Posts
    Placing a Logo in a Genesis WordPress Header

    Filed Under: WordPress Tagged With: child themes, CSS, genesis studiopress, Parent Themes, Theme Customization, WordPress

    Reader Interactions

    Comments

    1. Bobby K says

      August 10, 2020 at 9:17 pm

      Thanks man, nice tutorial.

    2. Jimmy Lee says

      October 26, 2021 at 7:08 am

      This article is much better than the ones I found from other hosting providers. Still, for beginners like me, it’s incomplete: I have to search now how to copy a file from the parent to the child theme. Thank you.

    3. ProfK says

      November 5, 2021 at 10:12 pm

      2 ways to copy a file:
      (1) Copy and paste
      • Select the file inside the parent theme folder
      • Go to the Edit menu > Copy (CMMD-C or CNTRL-C)
      • Go to the Edit menu > Paste (CMMD-V or CNTRL-V)
      (2) Duplicate
      • Select and file inside the parent theme folder
      • Go to the File menu > Duplicate (CMMD-D or CNTRL-D)

      Move the duplicated file to the child theme folder.

    Leave a Reply

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

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Primary Sidebar

    Affiliate Disclosure

    This website contains affiliate links, which means I may get a small commission (at no cost to you) if you use these links to make a purchase.

    Subscribe to Mailing List

    Sign up to get periodic updates on Anne's design and art adventures, and receive useful info. via her blog.
    * = required field

    We never share our email list with anyone.

    Looking for Something on this Site?

    Search the Web

    New Book Published!

    Kornegger book: Inside the Rainbow

    Art and design for book cover and interior

    Inside the Rainbow: Soul Connection in Nature, by Peggy Kornegger

    BUY THE BOOK!

    Peggy and I have completed our 3rd book together! This one is about soul connection in nature. Peggy is the writer, I'm the designer and artist. I think it's pretty darn special and hope you agree 🙂. Printed book and eBook are both available on Amazon.

     
    kornegger loseyourmind front cover
    Several of my paintings are in this book (including the cover)
    BUY THE BOOK!
     
    Check out my blog post about designing books: Self-Publishing Adventures

    Amazon Affiliate

    As an Amazon Associate I earn from qualifying purchases.

    Photo, Video & Design Software

    Affiliate Partners

    We receive compensation when you purchase a service or product via the links on this blog.

    Web Hosting

    StudioPress
     
    Bluehost Website Hosting

    Testimonials

    I received the notecards on Friday and it was on my to do list today to email you my deep appreciation for them. They are amazing and I am so glad to have them to share. I am sure I will order more in the future. You are such a gifted artist and I thank you for sharing in a way others can use the art.

    — Shari Spokes

    Your new pastel "Lettuce Lake” is really beautiful. Very, very nice.

    — Tony from Belmont, MA

    My dear sweet sister. I can’t tell you how much I love your pictures. I so much wanted something and was so sorry that I couldn’t pick something out at your sale. On the other hand, I so much wanted something that you had chosen for me. Its been on my mind and suddenly, your beautiful pictures arrived. They are beyond beautiful and I cried when I saw them. Sending you love and my bestness.

    — Marti from Reno, NV

    Copyright

    © 2000-2023 Anne S. Katzeff. All rights reserved. Unless noted, all artwork and text are copyrighted by the artist. Images may not be reproduced, manipulated, or used in any way without Anne’s written permission.

    Categories

    Graphic Design

    • AIGA
    • Design Is History
    • Janice Moore
    • Mass. Contractors

    Web Design

    • 978 Grid System
    • A List Apart
    • Adobe Color Tools (formerly Kuler)
    • AWWWards
    • Smashing Magazine
    • underthesite
    • www schools

    Tech-Computer

    • Adobe TV
    • Orramac
    • Teknoziz

    Comments

    In an effort to reduce spam, comments are restricted. Please email Anne if you have a comment or question that you are unable to post. Thanks for understanding.


    Archives

    Typography

    • 1001fonts
    • Adobe Type
    • Adobe Web Type
    • Bitstream
    • Dafont.com
    • Emigre
    • Font converter (free)
    • Font Spring
    • Font Squirrel
    • Google Fonts
    • I Love Typography
    • identifont
    • Typeinspire
    • Typewolf
    • Typoretum

    Photography

    • Creative Commons

    Footer

    Subscribe to Mailing List

    Sign up to get periodic updates on Anne's design and art adventures, and receive useful info. via her blog.
    * = required field

    We never share our email list with anyone.

    Contact

    Website
    Email

    Subscribe to RSS Feed

  •  ASK Design Blog
  • Connect and Share

  •  
  • Legal

    Privacy Policy
    Cookie Policy

    Copyright © 2023 · Optimal Theme · Built on the WordPress Genesis Framework· Customization and design by ASK Design