In WordPress, your theme controls the look and feel of your site. From the layout to the colors, your theme determines your site’s appearance. At times, you may want to change certain aspects of your theme without switching themes or creating a new theme. In these cases, you should use a child theme.
A child theme inherits all of the properties of the parent theme and allows you to make specific changes that will be preserved when the theme is updated.
Sometimes people want to change a single theme file for example the footer or perhaps the 404 file to customize what is displayed when a page is not found. If these changes are made within the actual theme files, they will be lost when the theme is updated. This is why it is always recommended to make changes in a child theme.
Files Required in a Child Theme
When created properly, a child theme consists of a folder with a minimum of two files style.css and functions.php which enqueues the parent style sheets so that they will be displayed with the child theme. This is done by adding a wp_enqueue_scripts action and wp_enqueue_style() to the child theme’s functions.php file. In the past, parent styles were called using the @import command in the style.css. This is no longer considered a best practice, and has been replaced by enqueuing styles.
If the parent theme uses multiple css files, each of these will need to be enqueued in the child theme.
Note that some themes may not support child themes.
For more details on the files required for a child theme along with instructions on creating a child theme, visit https://whiteglovewebtraining.com/how-to-create-a-wordpress-child-theme/
When Custom CSS Requires a Child Theme
Many themes now provide a Custom CSS area as part of their theme configuration interfaces. For example, the Divi theme by Elegant Themes includes an area to add custom CSS in their ePanel. In these cases, a child theme is only required if changes need to be made to an underlying theme file, for example footer.php.
Many theme changes can be set in the WordPress Customizer which is accessed from the Dashboard by selecting Appearance > Customize. If a theme does not include a way to add custom CSS within the theme’s configuration options, then a child theme is needed to make CSS changes that go beyond what can be set in the WordPress Customizer. In this case, the custom CSS will be added to the child theme’s style.css file.
Child themes provide a powerful option for making changes to a theme without requiring the creation of a completely new theme.
Complete details about Child Themes can be found in the WordPress Codex. https://codex.wordpress.org/Child_Themes