What is a child theme in WordPress and why use it?

A child theme uses another theme (the parent) as its base. It needs a style.css with a Template: line (the parent folder name) and usually a functions.php.

/*
Theme Name: My Child Theme
Template: twentytwentyone
*/

Any file you copy to the child with the same name replaces the parent file. The rest comes from the parent. The main reason to use it: when the parent theme is updated, your changes stay safe. See WordPress Child Theme.


Learn more about the similar topics:
Tutorials
WordPress Themes
WordPress Top Theme List
WordPress Theme Files and Functions
WordPress Template Hierarchy
WordPress Enqueue Scripts and Styles
WordPress Loop
WordPress WP_Query Class
Exercises & Assignments
Build and activate a minimal classic theme
Show the three latest posts with WP_Query
Load a stylesheet with wp_enqueue_style and a version
Show a message only on the front page
Create a child theme which changes the footer
Interview Questions & Answers
What is a WordPress theme?
What are commonly used WordPress theme functions?
Which function is used to get the home URL in WordPress?
Which are the necessary files for a WordPress theme?
What is the use of the wp_head() function in WordPress?
What is the WordPress Loop?
What is the difference between is_home() and is_front_page()?