What is a child theme in WordPress

Posted on November 13, 2023by SplashCodes Team

Splashcodes Childtheme

WordPress Child Theme

A child theme serves as an extension of the parent theme, inheriting its attributes and functionalities.

Why do we need a child theme

The purpose of a child theme is to allow users to customise the options and add additional changes without editing the core files of the parent theme. Having a child theme is important to not lose the changes when updating the parent theme. It is  considered as the safest way to make any changes to the theme that is in active state.

How to create a child theme manually with simple steps

Below are the step-by-step instructions to create a child theme manually in WordPress through dashboard

1. Log in to WordPress Dashboard, Go to plugins -> Add New  search for File Manager

2.You will find below suggestions. Click on Install Now and activate any plugin

3. Go to WP File Manager and navigate to /wp-content->themes and find the theme you wanted to add a child theme (In my case it is Twenty Seventeen)

4. Create a folder with the same name as the parent theme and add the word child (In my case it is  Twenty Seventeen Child)

5. Create the 2 files inside the folder with the extensions style.css and function.php .

6. Add below code to style.css and Save it.

/*
Theme Name: Name-child Theme
Theme URI: http://yourdomain.com
Description: Name-child Child
Theme Author: Your Name
Author URI: http://yourdomain.com
Template: Name-child
Version: 1.0.0
Text Domain: twenty seventeen-child
Licence: GNU General Public License or later
Licence URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
*/

Note :

Adjust all the values accordingly. The crucial field is ‘Theme Name,’ as it informs WordPress about the parent theme your child theme is built upon. After making the changes, click Save and Close.

7. Add below code to function.php and save it. This script will enqueue the parent theme stylesheet.

<?php
add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );
function enqueue_parent_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
}
?>

8. Congratulations, you are all done with the child theme creation.

Go to Appearance ->Themes and you can find your child theme is ready to activate.

Related Post

What is the website cost in India?

What is the website cost in India?

Creating and maintaining a website involves various factors. Among these factors, some of them are global standards, and the remaining depend on service providers and market conditions. 1. Domain It is the address of our website (for example, google.com for Google). Cost: Rs. 500 to Rs. 2000 per year 2. Hosting It is a place […]

Read More
Why Good Website Design Is Important For Schools

Why Good Website Design Is Important For Schools

In today’s digital age, a school’s website acts as a virtual front door and often makes the first impression on prospective students, parents, and even teachers. The importance of good website design for educational institutions cannot be overstated, as it directly impacts many aspects of a school’s functioning, reputation, and engagement. That’s why it’s important […]

Read More
How Digital Marketing is benefit for your school

How Digital Marketing is benefit for your school

In an era defined by digital innovation, schools are increasingly turning to digital marketing to enhance their outreach and impact. From bolstering enrollment numbers to fostering community engagement, digital marketing strategies offer a plethora of benefits for educational institutions. This article delves into the ways in which digital marketing can transform the landscape of a […]

Read More

Have a project in mind? Letโ€™s connect and turn it into reality

Scroll to Top