Child Themes Daisy Olsen http://daisyolsen.com
What is a Child Theme <ul><li>Installed and activated like any other theme
Dependent on a parent theme for elements not found in the child theme
Only style.css is required
Can be used to re-skin a theme
Can add functionality
Can over-ride parts of the parent theme </li></ul>
Why Use a Child Theme <ul><li>Future-proof your customizations
Rapid development
Build upon a consistent codebase
Understanding of PHP and WordPress themeing is helpful but not required for basic child themes </li></ul>
Child Theme Files <ul><li>WordPress template hierarchy
Upcoming SlideShare
Loading in...5
×

Meetup child-themes

2,875

Published on

Presentation for Westchester/Hudson Valley WordPress Meetup - September 29, 2010

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,875
On Slideshare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
11
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Meetup child-themes

  1. 1. Child Themes Daisy Olsen http://daisyolsen.com
  2. 2. What is a Child Theme <ul><li>Installed and activated like any other theme
  3. 3. Dependent on a parent theme for elements not found in the child theme
  4. 4. Only style.css is required
  5. 5. Can be used to re-skin a theme
  6. 6. Can add functionality
  7. 7. Can over-ride parts of the parent theme </li></ul>
  8. 8. Why Use a Child Theme <ul><li>Future-proof your customizations
  9. 9. Rapid development
  10. 10. Build upon a consistent codebase
  11. 11. Understanding of PHP and WordPress themeing is helpful but not required for basic child themes </li></ul>
  12. 12. Child Theme Files <ul><li>WordPress template hierarchy
  13. 13. style.css – Only Child theme file is used.
  14. 14. functions.php – Both parent and child files always run.
  15. 15. Other files – Child theme checked first then Parent theme. First file found runs. Specific -> General </li></ul>
  16. 16. Making a Child Theme <ul><li>Get to Know your Parent Theme
  17. 17. Create style.css
  18. 18. Page Templates
  19. 19. Overriding Parent Theme Files
  20. 20. Demo site : http://wpthemedemos.com </li></ul>
  21. 21. Required in style.css /* Theme Name: Twenty Ten Child Demo Description: A Child Theme for Twenty Ten for Demonstration. Theme URI: http://daisyolsen.com Author: Daisy Olsen Author URI: http://daisyolsen.com Template: twentyten Version: 1.0 */
  22. 22. style.css <ul><li>Option #1 – import style.css from parent theme @import url('../twentyten/style.css');
  23. 23. Option #2 – Copy/Paste entire style.css from parent theme into child theme style.css
  24. 24. Option #3 – Build new style.css from scratch </li></ul>
  25. 25. Hooks <ul><li>Twenty Ten has one hook built in for adding additional content. WordPress also includes some hooks that can be used. </li></ul>do_action( 'twentyten_credits' ); <ul><li>Think of a hook as an insertion point. </li></ul>add_action('twentyten_credits', 'my_credits'); function my_credits() { echo 'This is my credit line using a function'; }
  26. 26. Replace Theme Template Files <ul><li>Our Demo Child theme replaces the footer.php file with a customized version which changes the default footer credits with customized ones.
  27. 27. If a template file exists in the child theme the parent theme file is ignored. </li></ul>
  28. 28. Template Parts <ul><li>New to WordPress 3.0
  29. 29. Twenty Ten allows you to modify the loop by creating a new file in the child theme with a modified version of loop.php
  30. 30. We will modify the way the category archive displays with loop-category.php </li></ul>
  31. 31. Theme Frameworks <ul><li>Built with the intention of being modified via child theme
  32. 32. Extensive Action/Filter Capabilities
  33. 33. Active Development
  34. 34. Popular Parent/Child Frameworks </li><ul><li>Hybrid
  35. 35. Thematic
  36. 36. Genesis (Commercial) - StudioPress
  37. 37. Builder (Commercial) - iThemes </li></ul></ul>
  38. 38. Resources <ul><li>Codex: Child Themes
  39. 39. Aaron Jorbin's Guide
  40. 40. Understanding Child Themes
  41. 41. Modify WordPress Themes The Smart Way </li></ul>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×