Meetup child-themes

Download Meetup child-themes

Post on 15-May-2015




0 download

Embed Size (px)


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