fbpx

How can we help?

Create Child Theme

Wondering what does wonders for a website developer/ someone when he’s not sure about designing a website? It’s the activation of Child Theme!

Since you have landed here, it means you are among those who are facing problems when trying to make changes to a website, by editing parent theme directly.

This also means you are changing or adding files in the current parent theme’s folder resulting in loss of all the modifications once the theme gets updated.

Lets us get through how a Child Theme Helps you.

What is a Child Theme?

Child themes are those themes that are used to modify parent themes while still maintaining their design and code. They are the mirror reflection of the parent theme.

Such themes offer the basis for developers or creators to build new projects that inherit a parent theme’s features.

The main reason to create a child theme is when a user customizes or overrides the child template it will stay safe without affecting the parent theme.

Advantages of Child themes

  • Child themes add to your website’s overall performance. They make it much simpler to customize the theme. A custom WordPress theme can be generated simply by changing the CSS of your child’s theme.
  • Take advantage of the versatility of advanced structures using the child’s themes when tailoring the template to your needs.
  • Instead of having to design a full theme from scratch, you can expand on something that already exists, speeding up the time of creation.
  • If you aren’t satisfied with your customizations, just disable the childs themes and everything will be as it was before.
  • It’s a great way to start learning about how themes work.

Set Up a WordPress Child Themes

  • Creating a Child Theme Manually.
  • Creating a Child Theme Using Plugin.

Creating a Child Themes Manually

  1. Create a folder and name it something you can remember, Ex: “Parent_theme-child” in wp-content/themes
  2. A folder with any name has to be created under the Wp-content/themes, say child themes( make sure to not enter any kind of spaces for the folder name).

    Like any theme, childs themes are located in wp-content/themes in your WordPress installation. So, navigate there now and create a new folder for your child themes.

    • Parent Theme Folder Name: twenty fifteen
    • Childs Theme Folder Name: twenty fifteen-child
  3. Create a Style sheet file titled style.css
  4. Making a style sheet is easy: Simply create a new text file and call it style.css.

  5. Open the style.css and write the below information.
    	/*
    Theme Name: Twenty Fifteen Child
    Theme URI: http://example.com/twenty-fifteen-child/
    description: >-
      Twenty Fifteen Child Theme
    Author: John Doe
    Author URI: http://example.com
    Template: twentyfifteen
    Version: 1.0.0
    License: GNU General Public License v2 or later
    License URI: http://www.gnu.org/licenses/gpl-2.0.html
    Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
    Text Domain: twenty-fifteen-child
    */
    
  6. Here is what each line means:

    • Theme name. This is the name that will show up for your theme in the WordPress back end.
    • Theme URI. This points to the website or demonstration page of the theme at hand. This or the author’s URI must be present in order for the theme to be accepted into the WordPress directory.
    • Description. This description of your theme will show up in the theme menu when you click on “Theme Details.”
    • Author. This is the author’s name — that’s you, in this case.
    • Author URI. You can put your website’s address here if you want.
    • Template. This part is crucial. Here goes the name of the parent theme, meaning its folder name. Be aware that it is case-sensitive, and if you don’t put in the right information, you will receive an error message, so double-check!
    • Version. This displays the version of your childs theme. Usually, you would start with 1.0.
    • License. This is the license of your childs theme. WordPress themes in the directory are usually released under a GPL license; you should stick with the same license as your parent theme.
    • License URI. This is the address where your theme’s license is explained. Again, stick with what your parent theme says.
    • Tags. The tags help others find your theme in the WordPress directory. Thus, if you include some, make sure they are relevant.
    • Text domain. This part is used for internationalization and to make themes translatable. This should fit the “slug” of your theme.
  7. Create a file titled functions.php and paste below code to import the parent themes style.
    
    <?php
    add_action( 'wp_enqueue_scripts', 'enqueue_child_theme_styles', PHP_INT_MAX);
    
    function enqueue_child_theme_styles() {
      wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
    }
    ?>
    
    
  8. Now Zip the folder and upload it via Appearance >> Themes >> Add New
  9. Activate the theme.

Creating a Child Theme Using Plugin

  1. Download One-Click Child Theme plugin.
  2. Log in to the admin area of your site.
  3. Go to Plugins >> Add New.
  4. Click on Upload plugin to upload the plugin, then click on Activate plugin.
  5. Now go to Appearance >> Themes, make sure the theme you wish to create a child theme for is activated. (For example: if you wish to create a child theme of twenty sixteen make sure twenty sixteen is activated.)
  6. Click on the theme thumbnail, then click on Child Theme.
  7. After clicking that, you will be taken to the child theme configuration page. Write the Theme name, Description, and author field.
  8. Now your child themes is ready and activated.
Was this article helpful?
How can we improve this article?
Quick Links