Skip to content

Using a Child Theme ​

A child theme allows you to modify your site's appearance while preserving the core functionality of the parent theme.

What is a Parent Theme? ​

A parent theme is a fully functional WordPress theme that includes all required template files and assets. All themes β€” except child themes β€” are considered parent themes.

In your download package, πŸ“„ asli.zip is the parent Asli theme.

What is a Child Theme? ​

A child theme inherits all styles and functionality from the parent theme while allowing you to customize aspects of it. This ensures that your modifications remain separate from the parent theme’s files, preventing them from being lost during updates.

In your download package, πŸ“„ asli-child.zip is the child Asli theme.

Benefits of Using a Child Theme ​

Child themes allow you to:

  • Keep modifications separate from the parent theme.
  • Apply updates to the parent theme without losing customizations.
  • Save development time by reusing the tested structure of the parent theme.
  • Learn about WordPress theme development.

WARNING

Customizing a child theme is recommended for advanced WordPress users. If you're unfamiliar with coding, modifying a child theme could cause issues or site crashes.

Setting Up a Child Theme ​

If you followed the Wizard Theme Setup, the child theme is likely already installed. If not, extract πŸ“„ asli-child.zip from your download package and install it like a regular WordPress theme.

Child Theme installed and activated

Customizing PHP Files in a Child Theme ​

To override a .php file, copy it from wp-content/themes/<ThemeName lowercase />/ and paste it into wp-content/themes/<ThemeName lowercase />-child/, ensuring the full directory structure remains intact.

Example 1: Overriding the Header Template ​

  1. Copy πŸ“„ wp-content/themes/<ThemeName lowercase />/header.php
  2. Paste it into πŸ“„ wp-content/themes/<ThemeName lowercase />-child/header.php
  3. Edit the πŸ“„ header.php file in the child theme.

Example 2: Overriding the Preloader Template ​

  1. Copy πŸ“„ wp-content/themes/<ThemeName lowercase />/template-parts/preloader/preloader.php
  2. Create the following directory in the child theme:
    wp-content/themes/<ThemeName lowercase />-child/template-parts/preloader
  3. Paste the copied file into
    πŸ“„ wp-content/themes/<ThemeName lowercase />-child/template-parts/preloader/preloader.php
  4. Edit πŸ“„ preloader.php in the child theme.

Example 3: Overriding ACF Custom Fields ​

  1. Copy πŸ“„ wp-content/themes/<ThemeName lowercase />/inc/config-plugins/acf/fields.php
  2. Create the following directory in the child theme:
    wp-content/themes/<ThemeName lowercase />-child/inc/config-plugins/acf
  3. Paste the copied file into
    πŸ“„ wp-content/themes/<ThemeName lowercase />-child/inc/config-plugins/acf/fields.php
  4. Edit πŸ“„ fields.php in the child theme.