Dipping into Child Themes
My notes from Joseph Dickson’s WordCamp LA 2018 presentation, Dipping into Child Themes
My notes from Dipping into Child Themes presentation by Joseph Dickson at WordCamp LA 2018
Dipping into Child Themes – Joseph Dickson
Twitter: Joseph Dickson @joe4ska
Presentation abstract
Notes
- Child themes introduced in WordPress 2.7 in 2008
- why use child themes?
- speed up development time
- functionality goes into plugin
- themes and appearance go into themes
- functions.php
- Functions File Explained « WordPress Codex
- Add plugin support to a theme
- if you will be change theme use plugins
- try to keep functions pretty simple.
- Best used for theme specific functionality
- Add menus, specific plugin support and adjustments to functionality
- Open graph support to display featured images
- Replace google fonts with self hosted fonts
- used enqueue for loading styles and js into sites. code sample in slides and sample child theme
- wp_enqueue_script() | Function | WordPress Developer Resources
- Template hierarchy
- Template Hierarchy | Theme Developer Handbook | WordPress Developer Resources
- child theme’s template override the parent themes version
- fantastic for introducing new templates
- Template tag
- Template Tags « WordPress Codex
- Examples
- the_title()
- get_the_title()
- the_excerpt()
- get_the_excerpt()
- what is difference between get_the_title and the_title
- Conditional tags
- Conditional Tags « WordPress Codex
- Examples
- is_home()
- is_front_page()
- has_tag()
- is_front_page() and is_home()
- is_admin()
- in_category()
- use case: add class names if condition are met.