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 );

Disclaimer: You can help support content creation. If you click some of my links, WP Explainer may get a compensation. I only partner with companies and products that I’d happily recommend to my audience.

Follow on Youtube

Follow to recieve the latest tutorials and courses

Get the updates

Be the first to recieve the latest tutorials and courses.

  • This field is for validation purposes and should be left unchanged.