featured_wide17

The Purpose of WordPress Child Themes

‌‌
WordPress is quite a handy tool for web designers, but it definitely has a learning curve. Thousands of websites use WordPress as their Content Management System. The way that WordPress works is through themes, either custom built or purchased. When using a theme that was purchased or one that comes with an install of WordPress, like TwentyTwelve, it's best to create a child theme instead of making changes directly to the theme. But what is a child theme? The idea of creating a theme right after you've just purchased one that you like might seem a little weird. However, when using a child theme you can make changes to the theme without altering the original theme's code. If you create a child theme you'll make a completely different set of files that you'll used without ever having to touch the original theme. This will make it so much easier when it's time to update and it will make it so that you don't accidentally damage the original theme. Also, if you mess up the child theme you can just revert back to the original, or parent, theme. By default, WordPress will display a child theme over a parent theme, so you don't have to worry about setting anything up to make WordPress show your child theme. A child theme needs to have at least two files, style.css and functions.php. WordPress recommends that when you create a new directory for your child theme that you append the word "child" to it. Also, make sure that you don't add any spaces. So if you're wanting to create a child theme for TwentyTwelve, the suggested way to name your directory is twentytwelve-child. WordPress offers a lot of great information through their Codex. I recommend that you look through the WordPress Codex to find WordPress official support. It's most useful to use a child theme when you're customizing a theme. Most of the themes that WordPress offers for free, like their twentysomething series, are simple. With a few adjustments they can fit your purpose much better. If you use a child theme, you'll easily be able to revert back to the original theme if you make a mistake, or even if you just want to change something back to the way it originally was. Some themes aren't really meant to be customized, since they're purchased for a specific reason. However, there are other themes, like Skeleton or Catch Box, that are intended to be built upon. Think about a child theme as you would saving different files for different versions of your designs. Of course, you could still just save the file somewhere else so you could just copy and paste it back in if something goes wrong, but why go through all that hassle? Plus, if you just save the file somewhere and don't use a child theme, there won't be anything that you can fallback on if you forgot to code for something particular that was already in the parent theme. To learn more about creating a custom site through a child theme, check out our course Designing Custom Sites Using Child Themes in WordPress and CSS.