How to create a child theme

To make changes to your WordPress theme in a safe way it is highly recommended to use a child theme. To create a child theme you will need to follow these steps:

  1. Get a WordPress theme and install it on your website
  2. Create child theme directory under wp-content/themes and name it as your parent theme, but with -child prefix (ex. visual-composer-starter-child)
  3. In your child theme folder create style.css file
  4. Add stylesheet header to the file (see the value explanation below)
    /*
    Theme Name: Visual Composer Starter Child
    Theme URI: http://visualcomposer.io
    Description: Visual Composer Starter child theme
    Author: WPBakery
    Author URI: http://visualcomposer.io
    Template: visual-composer-starter
    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, blog, starter, responsive-layout, accessibility-ready, sandwich-menu
    Text Domain: visual-composer-starter-child
    */
  5. Create functions.php and add following code
    add_action( ‘wp_enqueue_scripts’, ‘enqueue_parent_styles’ );
    
    function enqueue_parent_styles() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri().’/style.css’ );
    
  6. Activate your child theme

Note: If you want to create a custom cover image for your theme – create image 1200×900 pixels, name it screenshot.png and upload to your child theme folder.

Style.css values

It is important to add proper values to your child theme style.css to work properly.

  • Theme Name: The name of the theme that will appear in your WordPress.
  • Theme URI: A URL to the theme demonstration which is required if you wish to push your theme to WordPress theme repository.
  • Description: Theme description that will appear in your WordPress by clicking on Theme Details option.
  • Author: The author of the theme – you.
  • Author URI: Author website address.
  • Template: The most important part – this is the place where you need to specify the name of the parent theme folder. This is case-sensitive and needs to be 100% correct in order to function as a child theme.
  • Version: A version of your child theme which is suggested to start with 1.0.
  • License: Specify the license of your child theme. Make sure that your license is the same as your parent theme license.
  • License URI: Link to the license explanation, when again you should follow your parent theme licensing.
  • Tags: Tags that are relevant to your child theme.
  • Text domain: Used to make your theme translatable and should fit the ‘slug’ of your theme.

Download child theme example

Download free child theme example for Visual Composer Starter theme based on this tutorial – child theme zip file.