fbpx
Did you miss our exclusive webinar on Attendee information? Click here to view the recorded session.
How can we help?

Create Child Theme

A child theme is a game changer especially for those developers who are not sure about designing a WordPress site. The child theme works like a subtheme of the main theme that carries all its functionalities, features and style.

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 refer to the themes that are used to modify the parent themes keeping their designs and code intact.  They are the mirror reflection of their parent theme.

The biggest advantage of creating a child theme is that when a user customizes a child template it does not affect the parent theme.

Advantages of a child theme include the following:

  • A child theme improves the overall performance of your website and makes it easy for users to customize the theme. A custom WordPress theme can be generated simply by changing the CSS of your child’s theme.
  • A user can easily customize the theme as per his or her needs. 
  • A child theme is undoubtedly a better alternative to creating an entire theme from scratch. 
  • One of the biggest advantages of the child’s theme is you can disable it anytime if you are not satisfied with your customizations. 
  • It also teaches users about how themes work.

Set Up a WordPress Child Themes

You can set up a WordPress Child theme mainly in two ways:

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

Creating a Child Themes Manually

  1. Create a folder and add a suitable title to it like “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).
  3. A folder with a name has to be created under the Wp-content/themes, say child themes( make sure you do not add any space to the folder name).
    Just like any other theme, child themes are located in wp-content/themes in your WordPress. 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
  4. Create a Style sheet file titled style.css.
  5. Making a style sheet is easy: Simply create a new text file and call it style.css. Open the style.css and write the below information.
  6. 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
    */
    
  7. 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 so that the theme gets accepted in 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 child theme. WordPress themes in the directory are usually released under a GPL license; you should stick to the same license as your parent theme.
    • License URI. This is the address where your theme’s license is explained. Again, stick to  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.
  8. Create a file titled functions.php and paste below code to import the parent themes style.
    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' );
    }
    
  9. Now Zip the folder and upload it via Appearance >> Themes >> Add New
  10. 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 theme is ready and activated.
Create Child Theme
Ashok Dudhat

Our team constantly explores ways that technology can help us reinvent industries. We want to change the world by creating great products that transform industries. We Dream It, We Make It.

Quick Links
Close
Close