WordPress is a playground for people who love experimenting and want to take matters in their hands. The platform is easy to customize and play with, such that you can tailor made your website according to your needs and preferences.
And one amazing way to play with the looks and layout of your website is my customizing your WordPress theme by using a child theme. This way, all the customizations that you do would be saved in a different folder, and they would not get lost when you update the parent theme.
For uninitiated, child theme is the mirror reflection of the original or parent theme. Thus, no matter what changes you make on your child theme, your parent theme will not reflect them. However, if any changes are made by the parent theme, those changes will reflect in your child theme.
If you want to modify your existing theme, using child themes to do so is one of the best and safest ways.
This way, even if your parent theme gets updates, your changes would not be deleted.
Further, if your child theme starts throwing errors, you can always disable it and move ahead with the parent theme.
There are two ways through which you can set up a WordPress child theme, and these include:
There are various free WordPress plugins which can help you in creating child themes. Some of these plugins include Child Theme Creator, Child theme Configurator and various others.
Here are the steps that you need to follow
You can also choose to create a child theme manually. You would just need a bit of HTML and CSS knowledge, and you should be good to go.
Here is a step by step procedure on how you can create a child theme manually.
/* Theme Name: Twenty-20 Template: twenty-20 */
<?php add_action(‘wp_enqueue_scripts’, ‘enqueue_child_theme_styles’, PHP_INT_MAX); function enqueue_child_theme_styles() { wp_enqueue-style(‘parent-style’, get_template_directory_uri(),’/style.css’); } ?>
This way, you can easily create a child theme, and update your parent theme without losing any changes and breaking any functionality.
Child themes are the separate entities, but they rely on parent themes for most of their functioning. If you have a child theme, WordPress will crosscheck the child theme and see if there is any additional functionality. If no such functionality exist, it will continue to use parent theme.
However, if you plan to change or modify even a slightest part of the theme, you should always use child themes for two pretty good reasons:
1. Organization
When you customize your existing theme or add code to it, you are basically adding code to a codebase of various lines. This makes it difficult to track all the changes. This is when child theme comes to your rescue and makes the things easier.
2. Updates
If you choose to modify a theme without using a child theme, it is likely that – you will not opt for updating themes in future, or, you will update and lose all the recently made changes.
This is when child theme helps you out by allowing you to update your theme without making you lose important changes.
That said, it is evident by now how important role a child theme plays. It takes off extra responsibility from your shoulders and helps you update the parent theme without second thought.
In order to create a child theme, all you need to understand is a bit of HTML and CSS. The above tutorial would have helped you in creating a child theme step by step. However, if this sounds like too much technical work for you, you can also choose to use plugins which is a simple way to create a child theme.
All you would need to do is install and activate the plugin, and it would take care of the rest.
However, if you are stuck anywhere and have any query, do let us know in the comments below.
Write a comment