Why You Should Use WordPress Child Theme
How to Create a Child Theme?
- Create a child theme folder
- Create a file titled style.css in a construction-child folder. Open the style.css, copy and paste the below code.
-
/*
Theme Name: Construction Child Template: construction
*/
- Again, Create a file titled functions.php in a construction-child folder, copy and paste the below code to import the parent themes style
<?php add_action( ‘wp_enqueue_scripts’, ‘enqueue_child_theme_styles’, PHP_INT_MAX) wp_enqueue_style( ‘parent-style ’, get_template_directory_uri(). ’ /style.css’ ); } ?> |
-
Now, Activate the theme
Now simply click on the activate button to activate your child theme
Conclusion
So, creating a child theme in WordPress will allow us to safely customize a website without editing any core files. The main benefit of using a child theme is that child theme lets you modify a parent theme.
Thank you for reading our article. We hope it gave you a certain idea about the WordPress child theme and the process to create one.