If you have changes to the wordpress themes and you are tired of making repeated changes everytime when the theme itself is upgraded, then the child-theme is there for you.
1. The wordpress child theme can by named anything but it is generally named by adding -child after the main theme e.g. twenty-twelve-child.
2. The child theme folder should be placed at the same level directory with parent theme.
wordpress-theme-folder
3. Active the child theme (and keep the parent theme because we need it). The child theme does not contain all template files. The wordpress will first look for the files under child theme, if can’t be found, then the corresponding template files will be used under parent theme folder.
4. Any addition functions/filters should be placed in the functions.php under child theme.
5. You should have a rtl.css file that has the following:
1 2 3 4 5 6 7 | /* Theme Name: twenty-twelve-child Template: Right to Left text support. */ @import url("../twentytwelve/rtl.css"); |
/* Theme Name: twenty-twelve-child Template: Right to Left text support. */ @import url("../twentytwelve/rtl.css");
6. You should add addition stylesheet at style.css under child theme folder.
1 2 3 4 5 6 7 8 9 10 11 12 | /* Theme Name: twenty-twelve-child Description: twenty-twelve-child Author: ACMer Template: twentytwelve (optional values you can add: Theme URI, Author URI, Version, License, License URI, Tags, Text Domain) */ ins { background: #ffffff; text-decoration: none; } |
/* Theme Name: twenty-twelve-child Description: twenty-twelve-child Author: ACMer Template: twentytwelve (optional values you can add: Theme URI, Author URI, Version, License, License URI, Tags, Text Domain) */ ins { background: #ffffff; text-decoration: none; }
7. For other files that you want to keep your own changes after parent theme is upgraded, then you should copy the file to child theme folder:
child-theme-example
8. Search ‘One Click Child Theme’ and this plugin does most of the above for you, so things can’t go wrong.
–EOF (The Ultimate Computing & Technology Blog) —
Last Post: Simple Example - Use Bash Shell to Match IP address
Next Post: Linux Tools: ddate and cat/proc/*