How to create child theme in wordpress

In this tutorials i will share How to create child theme in wordpress step by step, which will help you to more customization of your current wordpress theme.

Why use a Child Theme?

Why use a Child Theme, There are lots of reason to create child theme, here i have describe few of them. If you edited a theme and may be it will updated after some time, then all your changes will be lost. But by using child theme your changes will not lost. Second thing is you can speed up your development time by using child theme and also it is recommended by wordpress standard.

How to Create a Child Theme

Below is the step to create a child theme of your existing wordpress theme. There are at least two files are required to create a child theme i.e style.css and functions.php files.

The next step is define child theme descriptions in style.css. Add below code at the top of the style.css file. You can replace the header information as per your requirement.

After that add below code in your functions.php file. Alway avoid to call the parent theme stylesheet using @import in your style.css file, because it will load style.css file every time. The best way to call your parent stylesheet file by using a wp_enqueue_scripts action and use wp_enqueue_style() in your child theme’s functions.php file.

How to activate child theme in wordpress

After done all above changes, login in admin dashboard and click on Appearance => Themes. Select Twenty seventeen theme and click on activate button.

Please make sure to re-save your menu (Appearance > Menus, or Appearance > Customize > Menus) and also change the background & header images after activating the twenty seventeen child theme.

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:

Article Tags: , , , , , ,