How To Setup & Use A WordPress Child ThemeWhat is a WordPress Child Theme?
A child theme is a theme that inherits the functionality of a parent theme. It is a separate theme, that allows you to modify the parent theme without having to modify any of the parent theme’s files.Why should I use a WordPress Child Theme?
Child themes are particularly useful if you want to customize a non-custom theme that has updates. With a child theme, you can update the parent theme without losing the custom changes you have made to it. It can also make development more efficient, because your child theme will only contain the files from the parent theme that you’ve actually made changes to. This makes it a lot easier to find your past changes to make additional changes in the future.
1) Create a folder (i.e. /wp-content/themes/theme-child/)
2) Create a style.css file (i.e. /wp-content/themes/theme-child/style.css) that starts with the following:
WordPress Child Theme style.css
/ Theme Name: Theme Child Template: theme
3) Activate your new child theme in your WordPress Admin Dashboard: Appearance > Themes
4) Customize parent theme via child theme
For example if you wanted to customize the header.php file and it was at this location /wp-content/themes/theme/header.php, you would simply save a new version of header.php, then save & upload your edited version to this location in the child theme /wp-content/themes/theme-child/header.php – then the child theme’s header.php file will be loaded instead of the parent theme’s header.php file.
5) Use filters whenever possible
If you want to inject something into one of your plugins, you can do this with filters via the child theme’s functions.php file.Have any other tips for using child themes?
Would love to hear of other elegant ways anyone is customizing parent themes and plugins inside a child theme. Hacking plugins and themes after every update is lame, so anything you can do to avoid it is awesome! If you have any other tips for avoiding this, please share them!
Read the full post: http://penguininitiatives.com/setup-use-wordpress-child-theme/