
- Views: 4.1K
- Category: Wordpress
- Published at: 10 Jan, 2017
- Updated at: 18 Aug, 2023
How to create a child theme in wordpress
How to create a child theme in WordPress?
Why do you need a child theme in WordPress..?
If you need a child theme, you have a theme that is a parent theme, so first of all, what is the parent theme...?
A parent theme is a complete theme that requires a WordPress template, files, and assets for the theme to work.
A child theme inherits the parent theme and all of its functions so that you can customize any part of the theme. In this way, you can separate your customized theme from the parent theme's files,
So customizations are kept separate from the parent theme's files.
You can update/upgrade your parent theme any time without affecting the customizations you've made to your site using child-theme.
Today I will show you how to create a child theme in WordPress OR your WordPress project.
Note: I am creating a child theme for twenty seventeen, So my parent theme is twenty seventeen
Create a folder in your themes folder; I am creating a folder named twenty_seventeen_child.
Now create a file style.css in the twenty_seventeen_child folder.
Now open your style.css file and paste this code.
/*
Theme Name: Twenty seventeen Child
Theme URI: http://example.com/twenty-seventeen-child/
Description: Twenty seventeen Child Theme
Author: Shakzee
Author URI: https://www.shakzee.com
Template: twentyseventeen
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
Text Domain: twenty-seventeen-child
*/
Now go to your dashboard/Appearance/themes and find your child's theme like this.
Activate your child's theme and visit your theme/site; if your site is not showing any styling from your parent theme, now add @import URL('../twentyseventeen/style.css'); in your child's style.css file.
/*
Theme Name: Twenty seventeen Child
Theme URI: http://example.com/twenty-seventeen-child/
Description: Twenty seventeen Child Theme
Author: Shakzee
Author URI: https://www.shakzee.com
Template: twentyseventeen
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
Text Domain: twenty-seventeen-child
*/
@import url('../twentyseventeen/style.css');
https://www.youtube.com/watch?v=l-D9m_Jerlc
- Tag
- Child Them
- Wordpress
0 Comment(s)