# Using Child Theme

A child theme allows you to change small aspects of your site’s appearance while preserving your theme’s look and functionality.

# What is a Parent Theme?

A parent theme is a complete theme that includes all the required WordPress template files and assets for the theme to work. All themes – excluding child themes – are considered parent themes.

In your download package 📄kinsey.zip is the parent Kinsey theme.

# What is a Child Theme?

A child theme inherits the look and feel of the parent theme and all its functions but can be used to modify any part of the theme. This way, customizations are kept separate from the parent theme’s files. Using a child theme lets you upgrade the parent theme without affecting the customizations you’ve made to your site.

In your download package 📄kinsey-child.zip is the child Kinsey theme.

# How can Child Themes be useful?

Child themes:

  • make your modifications portable and replicable;
  • keep customization separate from parent theme functions;
  • allow parent themes to be updated without destroying your modifications;
  • allow you to take advantage of the effort and testing put into the parent theme;
  • save on development time since you are not recreating the wheel; and
  • are a great way to start learning about theme development.

WARNING

Child theme customizations are recommended only for advanced WordPress users. When customizing a child theme, please make sure you’re 100% certain of what you’re doing; otherwise, your website may malfunction or even crash.

# Setup Child Theme

If you went through the Wizard Theme Setup, you’re likely to already have the child theme installed and activated. If you skipped child theme installation, just get the file 📄kinsey-child.zip from your download package and install it as an ordinary WordPress theme.

Child Theme is installed and activated

# Customizing PHP Files

To modify a .php file in the theme, simply copy that file from the wp-content/themes/kinsey/ directory and paste it into the wp-content/themes/kinsey-child/ directory, respecting the full path and file name. WordPress will look for the required file in the child theme directory first and will use it if it exists. If it doesn't, it will look in the parent theme directory.

# Example 1. Overriding header template

  1. Copy the file 📄wp-content/themes/kinsey/header.php and paste it into 📄wp-content/themes/kinsey-child/header.php
  2. Edit the 📄header.php file in the child theme.

# Example 2. Overriding preloader template

  1. Copy the file 📄wp-content/themes/kinsey/template-parts/preloader/preloader.php
  2. Create a new directory structure in the child theme wp-content/themes/kinsey-child/template-parts/preloader
  3. Paste the copied file into 📄wp-content/themes/kinsey-child/template-parts/preloader/preloader.php
  4. Edit the 📄preloader.php file in the child theme.