How to create a child theme in WordPress

It’s important to create a child theme in WordPress. It lets you modify your theme without losing your changes each time the theme is updated.

 Posted April 4, 2016

Why do I need a child theme?

If you’ve modified any of your theme’s files directly, you’ll lose any changes you’ve made when your theme is updated. By using a child theme, you can override your theme’s settings without running the risk of losing your work.

How to create a child theme:

In this example, we’ll create a child theme for the Twentysixteen theme that comes pre-installed with WordPress.

1. Create a new folder for your child theme in “/wp-content/themes” of your WordPress installation. To keep it simple,¬†we’ll call our folder “twentysixteen-child”:

2. Go into your new folder

3. Create a file named “style.css” containing the following:

Change the name/description/author to whatever you like, but the “Template” must be parent theme’s folder name (located in /wp-content/themes/).

4. Create a file named functions.php containing the following:

 

Leave a Reply

Your email address will not be published. Required fields are marked *