Close Menu
Infoceptor
  • Business
  • Finance
  • Technology
  • Health
  • Life
  • More
    • Auto
    • Food
    • Health
    • Home
    • Space
    • Travel

Subscribe to Updates

Get the latest creative news from FooBar about art, design and business.

What's Hot
Flywheel Logo

Flywheel review in 2023

June 8, 2023
Travel restrictions in Canada are different depending on where you're traveling from and to. Here's what you need to know before you go.

Canada: Traveling restrictions and what you need to know before you go

May 19, 2024
If you are planning a trip to Spain, there are some travel restrictions that must be taken into consideration.

Spain: Traveling restrictions and what you need to know before you go

May 19, 2024
Facebook X (Twitter) Instagram
Infoceptor
  • Business
    This guide will show you how to determine the value of your business using different business valuation methods.

    How to value you business – The ultimate guide for 2023

    May 9, 2024
    Have you ever thought of starting your own laundry service? Find out how with this easy guide.

    How to start a laundry service company in 2023

    May 5, 2024
    Learn about the best online payment solutions available to you. Check out what’s available, learn their pros and cons, and choose the one that best fits your needs.

    The 15 best online payment solutions in 2023

    April 27, 2024
    Learn how to create powerful backlinks for your website and increase your site's search engine ranking.

    How to build backlinks to your website

    April 25, 2024
    In this beginner's guide, we will show you the steps involved in creating a mobile app.

    Beginner’s guide on how to develop a mobile app

    April 24, 2024
  • Finance
    Learn how to build wealth and financial security. This article will share steps you can take to build a reliable cash reserve that will grow over time.

    Do you want to build wealth? Here are some ways to grow your money

    May 18, 2024
    Want to know your tax bracket? Check out our article for an overview of the different brackets and what you can expect to pay in 2022.

    Understanding IRS tax brackets – here’s what you’ll pay in 2023

    May 14, 2024
    This article will cover the best electric vehicle battery stocks to buy and invest in.

    The 10 best EV battery stocks to buy in 2023

    May 9, 2024
    The 10 most active penny stocks to watch this year is a list of the most active penny stocks ranked by total volume.

    The 10 most active penny stocks to watch in 2023

    May 8, 2024
    These electric car stocks are making a lot of money and you should consider adding them to your portfolio.

    The best electric car stocks to buy in 2023

    May 8, 2024
  • Technology
    Flywheel Logo

    Flywheel review in 2023

    June 8, 2023
    This article provides a list of the top iPhone models available today. Each model is reviewed based on features, specifications, performance, design and price point.

    Top iPhone models we’ve tested and you should get

    May 17, 2024
    Find out everything you need to know about the Apple Airpods Pro, including their price, features and if they're worth buying.

    Are Apple AirPods Pro a great choice in 2023?

    May 17, 2024
    To help you find the best responsive WordPress themes, we analyzed more than 100 themes and found those that are currently trending.

    The best responsive WordPress themes in 2023

    May 16, 2024
    These sympathy gifts make a great way to show you care while they also help your loved ones get through the tough times.

    The 15 best sympathy gifts that will show you care

    May 15, 2024
  • Health
  • Life
    These sympathy gifts make a great way to show you care while they also help your loved ones get through the tough times.

    The 15 best sympathy gifts that will show you care

    May 15, 2024
    Water bottles are a great way to stay hydrated. This article is dedicated to the most popular water bottles of the year!

    The best water bottles of 2023

    May 10, 2024
    Learn 30 weird and fun facts that will make you question everything.

    30 weird and fun facts that will make you question everything

    May 10, 2024
    Find out which cities in the US are the best for quality of life by checking out this article.

    20 best cities for quality of life in the USA

    May 7, 2024
    There are many ways to print your designs on t-shirts. Check out our list of the best printing services that offer top-notch quality at affordable prices.

    The 10 best T-shirt printing services of 2023

    May 6, 2024
  • More
    • Auto
    • Food
    • Health
    • Home
    • Space
    • Travel
Facebook X (Twitter) Instagram
Trending
  • Flywheel review in 2023
  • Canada: Traveling restrictions and what you need to know before you go
  • Spain: Traveling restrictions and what you need to know before you go
  • Do you want to build wealth? Here are some ways to grow your money
  • Our in-depth review of the Always Pan
  • Top iPhone models we’ve tested and you should get
  • Are Apple AirPods Pro a great choice in 2023?
  • The best shower heads of 2023
Infoceptor
Home»Technology»WordPress»How to create a WordPress child theme
WordPress

How to create a WordPress child theme

Asih TirtaBy Asih TirtaSeptember 7, 20236 Mins Read
Facebook Twitter LinkedIn Reddit Telegram WhatsApp Pinterest Email
Share
Facebook Twitter LinkedIn

WordPress is well known for its almost limitless possibilities for customizations, making it one of the most popular CMS (Content Management System) today.

However, you need to follow specific guidelines to keep your customizations in place and website from breaking.

This is where WordPress child themes come into play – they allow you to customize your website’s appearance and keep all your customizations in place.

What is a child theme?

Child themes look and work the same as a regular WordPress theme. Just by looking at a child theme – you wouldn’t notice it’s not a regular theme.

However, the significant difference is that child themes require a parent theme to work on your website and inherit all of its characteristics.

When you create a child theme, you can customize it all you want without affecting your parent theme in any way.

A child theme allows you to update your WordPress theme safely without running the risk of breaking all the changes you’ve made previously.

Also, it’s easier to keep track of changes you’ve made as they exist in one layer of your website, i.e., on your child theme.

Most themes have hundreds of different files and trying to remember all the files and places where you’ve made changes can become overwhelming.

A child theme solely contains files that you’ve modified, so it’s easier to stay on top of things and keep organized.

Here’s an example:

Let’s say you create a child theme for the default Twenty Twenty-One WordPress theme – WordPress will list your child theme as a separate item, but the child theme will inherit all styling, properties, and characteristics of the parent Twenty Twenty-One theme.

Any tweaks you make to the child theme will override the parent theme. In this way, your child theme acts as a customization layer on top of the parent theme.

When should you use a child theme?

 Deciding if you want to use the child theme is pretty easy:

  • If you’re happy with your WordPress theme and you don’t plan on making any changes – you should stick to a parent theme, you won’t require a child theme

However

  • If you plan to customize the visuals, features, and the style of your WordPress theme – then you should use a child theme for your website

If you only want to make small CSS changes, we recommend using the WordPress Theme Editor (Dashboard > Appearance > Theme Editor) as it’s easier than using a child theme.

Here are some additional benefits of using a child theme:

  • Helps avoid breaking your website, especially if your theme receives frequent updates (which is a good thing), as changes made to the child theme won’t get overwritten by updates
  • Allows you to test changes without performing them on your active (parent) theme and running the risk of breaking your website

How to manually create a child theme

To create your child theme manually, you’ll have to use FTP or your File Manager. 

Enter your WordPress main directory (public_html if it’s your main website) and then navigate to wp-content/themes 

Here you’ll find a folder for each of the installed themes on your website:

Go ahead and create a new folder for your child theme. In this example, we’ll create a child theme for the default Twenty Twenty-One theme, and we’ll call it twentytwentyone-child:

You can use any name you want, but we recommend using the theme-child pattern for practical purposes.

Next, we need to create the theme stylesheet file. Each theme uses its unique stylesheet, which is the case for a child theme.

A child theme inherits the parent theme styles, but it allows you to override those by adding new code to the style.css file.

Additionally, the child theme’s style.css file notifies WordPress that your child theme is active as well. 

Create a new style.css file on your computer, and paste the following code:

/*
 Theme Name: Twenty Twenty One Child
 Theme URI: http://yourwebsite.com/twenty-twenty-one-child/
 Description: Your new child theme!
 Author: Your Name
 Author URI: http://yourwebsite.com
 Template: twentytwentyone
 Version: 1.0.0
 License: GNU General Public License v2 or later
 License URI: http://www.gnu.org/licenses/gpl-2.0.html
 Tags: child theme
 Text Domain: twenty-twenty-one-child
 */

This seems like an excessive amount of information, but you only need to change one essential setting:

Template – this tells WordPress the parent theme your new child theme uses. The Twenty Twenty-One theme uses the twentytwentyone folder for theme files which is the reason we included it in the template configuration. If you’re using a different parent theme – make sure to insert the correct folder name.

Additionally, you can alter the Theme Name and Description as these show in the Dashboard under Appearance > Themes, and you can leave all the other information as is.

Go ahead and upload the file to your wp-content/themes/twentytwentyone-child folder:

Now, go to your WordPress Dashboard > Appearance > Themes, and you’ll see your new child theme displayed there:

Don’t try to activate your child theme yet as we haven’t configured it to inherit the parent theme’s functionality.

To do that, create a new functions.php file on your computer, and paste the following code:

<?php
// enqueue parent styles

function ns_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}

add_action( 'wp_enqueue_scripts', 'ns_enqueue_styles' );

Save the file and upload it to your wp-content/themes/twentytwentyone-child folder.

There is no need to adjust anything in this code as we’ve made all the required changes in the style.css file. 

Now we’re ready to activate the child theme!

Go to your WordPress Dashboard > Appearance > Themes, hover your mouse over the child theme, and click Activate:

Go to your website and test that everything works correctly.

Finally, let’s go the extra mile and add a theme thumbnail so it doesn’t show a transparent square in our WordPress dashboard.

The easiest way is to take a screenshot of our active website. If you use Firefox, you can do this by right-clicking the page or use Page actions > Take a Screenshot feature:

We recommend using a 880×660 resolution, but 387×290 works as well. A higher resolution works best for bigger screens.

Once you resize the image file, rename it to screenshot.png and upload it to the wp-content/themes/twentytwentyone-child directory.

Now when you check the theme thumbnail in WordPress dashboard > Appearance > Themes, you should see the correct image:

That’s it! You’ve now successfully created a new child theme.

People also viewed:

How to install a WordPress child theme How to change your WordPress theme The 3 best ways to speed up your WordPress website How to set up forums on WordPress using the bbPress plugin How to speed up WordPress by disabling WP-cron
child parent theme WordPress
Share. Facebook Twitter LinkedIn Reddit Telegram WhatsApp Pinterest Email
Previous ArticleHow to add cache to your WordPress website
Next Article How to protect your team from an abusive customer
Asih Tirta

Asih is a Infoceptor Technology writer, she is passionate about how technology can serve people and improve lives. She helps run code camps for K to 12 to teach young girls how to code and open doors to careers in tech for women.

Related Stories

How to set up forums on WordPress using the bbPress plugin

February 6, 2024

How to change your WordPress theme

December 29, 2023

The 3 best ways to speed up your WordPress website

September 7, 2023

How to install a WordPress child theme

September 7, 2023

Comments are closed.

Connect
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
  • LinkedIn
  • Reddit
  • TikTok
Don't Miss
Flywheel Logo Reviews

Flywheel review in 2023

By Matthew Drummond

Flywheel is a fast-growing web host that offers high-performance WordPress hosting for agencies, designers, and developers.

Travel restrictions in Canada are different depending on where you're traveling from and to. Here's what you need to know before you go.

Canada: Traveling restrictions and what you need to know before you go

May 19, 2024
If you are planning a trip to Spain, there are some travel restrictions that must be taken into consideration.

Spain: Traveling restrictions and what you need to know before you go

May 19, 2024
Learn how to build wealth and financial security. This article will share steps you can take to build a reliable cash reserve that will grow over time.

Do you want to build wealth? Here are some ways to grow your money

May 18, 2024
  • Auto
    • Auto Reviews
    • Electric
    • Insurance
  • Business
    • Company
    • Government
  • Entertainment
    • Movies
    • Music
  • Finance
    • Credit Cards
    • Crypto
    • Market
    • Personal Finance
  • Food
    • Coffee
    • Drinks
    • Holidays
  • Health
  • Beauty
  • Fitness
  • Food
  • Medical
  • Home
  • Backyard
  • Bathroom
  • Bedroom
  • Cleaning
  • Furniture
  • Home Office
  • Kitchen
  • Life
  • Astrology
  • Family
  • Fashion
  • Outdoors
  • Personal
  • Pets
  • Apple
  • Audio
  • Domain Names
  • Gaming
  • Google
  • Power
  • Reviews
  • Samsung
  • Destinations
  • Gear
  • Services
  • Space
  • Tourism
  • Technology
  • Tutorials
  • Web Hosting
  • WiFi
  • WordPress
  • Travel
  • Shopping
  • Sports
  • Work
  • Stocks
  • Television
  • Web Hosting
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn Reddit TikTok
© 2025 Infoceptor

Type above and press Enter to search. Press Esc to cancel.