Why and how to use a child theme
Customise a theme without losing changes on update.
If you edit a theme's files directly, the next theme update overwrites your changes. A child theme holds your changes separately and inherits everything else from the parent.
- Many themes offer a ready-made child theme to download. Otherwise, create a folder in
wp-content/themes(for examplemytheme-child) with astyle.cssthat starts:
/*
Theme Name: My Theme Child
Template: mytheme
*/- Activate the child theme under Appearance → Themes.
- Put your custom CSS in its
style.cssand custom code in itsfunctions.php.
Only need a few CSS tweaks? Appearance → Customize → Additional CSS is simpler and also survives updates.