How and why to create a “child theme” in WordPress

Child themes are those which inherit styles and functionalities from another parent theme.

Why use child themes?
One of multiple utilities reside in change ,for example, only the styles/appearance without creating a new theme (because a child theme, just require a style.css file). For example, if you want to change colorset of your current theme and you edit their style.css, everything will be ok… until you update your theme and you will lose all your changes.

How to do that?
Is simple as just create one folder in your /wp-content/themes/ , just as another wp theme. Then, just copy (eg.) parent theme style.css, and add this at the beggining:

/*
Theme Name:     Responsive personalitzat
Description:    Child theme for responsive theme
Author:         Albert Casadessús
Author URI:     http://www.albertcasadessus.com/
Template:       responsive
Version:        0.1.0
*/

Where Template must be the name of the parent theme folder (case sensitive!). Above there’s style.css of my child theme to change a bit the responsive theme I use.

So in this example, my folder struct will be:
/wp-content/themes/responsive_child
/wp-content/themes/responsive_child/style.css
(and if you want to modify another files, just put in the folder and think about the header above)
/wp-content/themes/responsive/
/wp-content/themes/responsive/(with all the files of the theme)

Leave a Reply

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