We begin with an introduction about why child themes are so important and then dig right into how to create one. In this child theme we will create a child theme for the TwentyTwenty theme.

Download the Twenty Twenty child theme here.

Code for your functions.php file


/* child style */
function childtheme_enqueue_styles() {

wp_dequeue_style( 'twentytwenty-style' );

wp_enqueue_style( 'parent_style', get_template_directory_uri() . '/style.css' );

wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css' , false,filemtime( get_stylesheet_directory() . '/style.css' ), 'all' );

}
add_action( 'wp_enqueue_scripts', 'childtheme_enqueue_styles', 999 );