• Call Us: +92-333-7276335
  • - Mail Us: info@shekztech.com

Plot 1177, Sector 31B - Crossing, Karachi, Sindh

Loading...
How to create a child theme in wordpress
  • 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 seventeenSo 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

Shehzad Ahmed

Shehzad Ahmed is a highly qualified expert with a Master of Philosophy in Computer Science and a decade of extensive industry experience. With his impressive track record in web development and computer science, he has not only left an indelible mark on the industry but also made substantial contributions to education. Since , he has created more than eighty exhaustive courses, paving the way for innumerable individuals interested in learning and development. His unparalleled knowledge and innate ability to elucidate complex ideas make him a highly sought-after educator and consultant. Choose Shehzad and take advantage of his exceptional balance of technical expertise and teaching prowess to propel your learning journey or project to new heights.

0 Comment(s)
Write your comment