Are you searching for creating a child themes for your WordPress website, because it is the greatest way to customize WordPress themes properties, Like, header, footer, themes colour, font size and more . . ., In this article, I will show you how to create a child theme in WordPress, but before I start you need to know some basic terms about WordPress child theme.
What is Child Theme?
A child theme is a theme that derive the functionality, Properties and styling of another theme, called the parent theme. You can customize the child theme without affecting the parent theme.
Why Need of Child Theme?
There are some reasons why we use child theme
- When new version of theme updated then you lost your theme setting and styling, but they did not affect the child theme so you can preserve your settings and style by creating child theme.
- You can increase the development time.
- It is great way to learn WordPress Themes development.
Basic thing you should know like understanding of CSS and HTML, knowledge of PHP would help.
How to Create Child Theme
You need to create 1 directory, 1 files (Style.css)
You can use any WordPress theme as a parent theme for your website, but I recommend that you should use default theme like Twenty Sixteen.
Creating Child Theme Directory
Initially you have login into your WordPress website via your chosen FTP client, of File Manager, navigate to “/wp-content/themes/” / in your WordPress installation folder and create a new folder or directory for your child theme. You can name it whatever you want but name should be meaningful that would help you to understand the difference between parent theme and child theme like Twenty-Sixteen-Child-Theme.
Enter the name of child theme and click OK button, your directory will be created.
Once directory is created, it’s time to create style.css.
You will need to place some source code to this directory, there are 2 options through which you can put the code to the child theme directory, so 1st open up your favorite text editor like notepad++ and paste the following code into a blank file and save as style.css. Upload the CSS file to the child theme directory either by FPT or File Manager.
Note: @import url (“../twentysixteen/style.css”); this code inherits the style properties of parent theme style.
2nd option is the go to child theme directory via FTP client and create new file, give the name of file is style.css and click OK. Your css file is created now open the file and insert the code above and save it.
Your css file will looks like below image
Now’s it’s done, you only need to do is activate the theme using admin panel. Since I haven’t changed anything in child theme yet, your site will use all functionality and appearance of its parent theme.
Activate the Child Theme
Now you can customize your newly created child theme css file, for that you need to know basics of css, once you ready. you would be fully control of your theme styling.a
Latest posts by Ratnesh (see all)
- 7 Ways of Securing your Web Server from Hacking - September 16, 2019
- Word Count and its Importance in Blogging 2019 - September 16, 2019
- What are the Best WordPress Security Plugins to Secure your Site? - September 14, 2019