By popular request there follows the definitive guide to setting up a child theme to use with the Incentive theme.
1. Give the child a name
Inside the wp-content/themes/ folder create a new folder named charley.
2. Give the child some style
Create a file inside the charley folder named style.css with the following content:
/* Theme Name: Charley Description: Child of the Incentive theme Author: Howard Fast Version: 1.0 Template: parallelus-incentive Tags: threaded-comments,translation-ready,responsive,retina,hidpi,clean,modern */ @import url("../parallelus-incentive/style.css");
Then create three more css files:
style-skin-1.css style-skin-2.css style-skin-3.css
The content of the style-skin-1.css file is four lines, as follows:
/* Skin Name: Skin 1 */ @import url("../parallelus-incentive/style-skin-1.css");
The content of the other skin files is similar to the style-skin-1.css file above, except that you change according to the skin number the Skin Name on line 2 and the file name of the imported file on line 4.
/* Skin Name: Skin 2 */ @import url("../parallelus-incentive/style-skin-2.css");
/* Skin Name: Skin 3 */ @import url("../parallelus-incentive/style-skin-3.css");
3. Give the child some assets
Copy the entire assets folder from the parallelus-incentive folder into the charley folder.
4. The child needs some settings
Copy the entire data folder from the parallelus-incentive folder into the charley folder.
These data files are needed for the Theme Options admin page to function properly and you should never edit these data files.
5. A child is born
Go to Appearance > Themes and activate the Charley theme.
Go to Appearance > Menus > Theme Locations and make sure the Primary Menu option is set to the correct menu.
From now on you can make any style additions or alterations to the relevant skin CSS file in Charley, but remember that the @import
must be the first CSS in the file, there must be nothing before the @import
except comments.
Other things you can do with a child theme include making your own functions.php file that could contain (for example) additional shortcodes, custom post types or custom taxonomies.
If you wanted to mess with a page template, let’s say the single.php file that determines how each individual post is displayed, then you would copy single.php from parallelus-incentive into charley and then you would make whatever changes you wanted to the charley/single.php file, leaving the original Incentive template untouched.
Resources
- WordPress child theme documentation: http://codex.wordpress.org/Child_Themes