Creating A WordPress Child Theme – Why and How?

The results of a recent survey by WordPress Themes suggest that around 85% of individuals buying themes for their WordPress website are looking to customise that theme further – to make their website more individual, or to add additional functionality. However, the figures suggest that only around 35% of those surveyed were using a child theme. {Tweet}

A child theme is particularly important if you want to make edits to fundamental aspects of your theme – for instance, any .php files. This also includes .css files – although it is now commonplace for themes to include an area within the back-end to allow you to edit the .css without having to go through the process of setting up a child theme.

In short, child themes are important to ensure that as the main theme is upgraded to offer new features, or to improve security, you don’t lose any of the changes you’ve made in terms of layout or functionality. {Tweet}

Creating A WordPress Child Theme – The Process

Creating a WordPress child theme is very simple. Within your WordPress install (you will need an FTP to access this, or the logins for your hosting provider) go in to the WP-Content folder, and then in to Themes. In this folder, you need to create a new folder – generally this is named after the Theme on which your child will be based, so: ‘Theme-Child’.

In the child theme folder, create a .css file called ‘style.css’ in a plain text editor (such as Notepad for instance). Within this style.css file, all you need to add is the following – replace ‘theme’ with the name of the theme you are basing the child on, and feel free to change the author name and author URI. Note, the below are case sensitive – so if your original theme is called ‘Fruity’, the template needs to ‘Fruity’ too.

Creating A WordPress Child Theme - Why and How - Rippleout Marketing

Creating A WordPress Child Theme – The style.css File

The most important parts of the above are the Template element, and the @import element – remember to alter the name of the theme in the import URL, and remember that it needs to be case sensitive!

This will basically important all the settings from the original theme, but any changes you make to the .css in the style.css element of the child theme will be loaded after the original theme, meaning they will override them any your changes will be visible. The same is true for .php files – you just need to copy the files over in the backend in the same way as you did with creating a new style.css file, and you can then edit the .php for the child theme.

Of course, if you need help with this or anything else to do with your WordPress site, or with marketing more generally, feel free to get in touch using the contact page.

If you liked this post, why not sign up to our monthly newsletter in the footer? You can also sign up to receive notification of each new post as it is published using the form on the right hand side of this page. In addition, please feel free to follow Rippleout Marketing on Rippleout Marketing Twitter, the Rippleout LinkedIn page, or on Rippleout Marketing's Google+ page.

We welcome comments from all our readers - so please feel free to express your views in the space below.