What is a child theme?

It is an extension of your parent theme. The parent theme is the main theme while your child theme will contain the files of the changes you’ve made in bid to overwrite the parent theme.

Most themes would contain a child theme for you, where you activate that theme and you can make changes to the theme files directly, introducing style changes and even implement Javascript for your page.

Why not directly make the changes on the main parent theme? This is because when updates of the main theme (also known as the parent theme), this ensures the  changes you made previously will still be valid, as its on a separate file.

The naming of the child theme, is just adding a '-child' behind the file.
The naming of the child theme, is just adding a ‘-child’ behind the file.

Why do we use a child theme?

Often when you installed your purchased theme, you’ll might want to overwrite certain styles or functions of the original theme. However, directly editing the files of the theme is bad practice. This is because when the theme does an update, all you changes would be overwritten. It is also harder to track the changes you’ve made as well.

What does a child theme usually contain?

Style sheet – style.css
Functions – functions.php

In order for the style sheets and functions to overwrite the parent files, certain code must be written in the child’s function.php file to enqueue the files.  See https://codex.wordpress.org/Child_Themes  on how to enqueue the files.

However, most themes comes along with a child theme that’s ready with the files. So you can just activate that theme.

This is the fourth article of my wordpress series on how to set up your first wordpress site.

You can checkout the first three articles here

  1. “Setting up WordPress on Localhost”
  2. “WordPress.org vs WordPress.com”
  3. “Choosing the right theme for you website”

Subscribe to my newsletter

Updates on with wordpress plugins, tips and reviews!

Leave a Reply

Your email address will not be published.