Getting Comfortable With Child Themes - WordCamp Miami

1,030 views

Published on

Child themes are a simple but powerful way to customize a pre-made theme. Learning how to use them properly means you’ll never risk losing all your modifications when the developer releases a new version and you update the theme. Using easy-to-follow language, I’ll walk you through the steps to set up a child theme and we’ll get started making some tweaks – from CSS look-and-feel adjustments to more substantial changes in functionality.

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,030
On SlideShare
0
From Embeds
0
Number of Embeds
135
Actions
Shares
0
Downloads
4
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Getting Comfortable With Child Themes - WordCamp Miami

  1. 1. Kathryn Presner WordCamp Miami 2014 @zoonini #wcmia  
  2. 2. Kathryn Presner Happiness Engineer Automattic Theme Team
  3. 3. https://www.flickr.com/photos/ben124/5396260658
  4. 4. https://www.flickr.com/photos/sackton/8258253775/
  5. 5. Brownies Cream butter and sugar. Beat in eggs and vanilla. Add dry ingredients. Spread in pan, bake at 350F for 30 min. 1 cup sugar ½ cup butter 2 eggs 1 tsp vanilla 1 cup flour ¼ cup cocoa ½ tsp. salt
  6. 6. Child theme = recipe variation https://www.flickr.com/photos/snekse/399462304
  7. 7. Brownie Variations Blondies + brown sugar - white sugar Mint brownies + add mint extract - vanilla Nutty brownies + nuts Double chocolate mini muffins + choc. chips +bake in mini-muffin tin
  8. 8. https://www.flickr.com/photos/handcoding/2117794703
  9. 9. Parent Theme != Starter Theme
  10. 10. Why?
  11. 11. Why? Faster development
  12. 12. Why? Benefit from others' design, coding
  13. 13. Why? Safer updates
  14. 14. Why not?
  15. 15. Why not? Untangling others' code
  16. 16. Why not? Can feel hacky
  17. 17. Why not? Can be inefficient
  18. 18. http://wordpress.org/themes/
  19. 19. Sorbet
  20. 20. One-minute child theme setup For reals!
  21. 21. Setup parent
  22. 22. Setup parent child
  23. 23. Setup parent child
  24. 24. Setup parent child
  25. 25. Setup required file
  26. 26. style.css
  27. 27. style.css
  28. 28. Activate child theme
  29. 29. Import parent styles
  30. 30. https://www.flickr.com/photos/47741487@N06/7994654729
  31. 31. https://www.flickr.com/photos/healthcare4every1/3743271846
  32. 32. Template files YES Use child's file NO Use parent's file Does template file exist in child theme?
  33. 33. and so on ...
  34. 34. content.php
  35. 35. content.php
  36. 36. content.php in parent
  37. 37. content.php in child https://codex.wordpress.org/Post_Formats#Using_Formats
  38. 38. Create custom template http://codex.wordpress.org/Page_Templates#Creating_a_Page_Template
  39. 39. https://www.flickr.com/photos/stefz/2159280574
  40. 40. Functions – loading order 1. Child's functions.php loaded 2. Parent's functions.php loaded
  41. 41. Duplicate functions
  42. 42. Hooks, actions, filters https://www.flickr.com/photos/bonitoclub/7959426472
  43. 43. https://www.flickr.com/photos/nationalzoo/4368143044
  44. 44. Grandchild themes? https://www.flickr.com/photos/nationalzoo/4368143044
  45. 45. Resources Child Themes – Codex https://codex.wordpress.org/Child_Themes Conditional Tags – Codex http://codex.wordpress.org/Conditional_Tags Functions – Codex https://codex.wordpress.org/Function_Reference/
  46. 46. Resources ThemeShaper http://themeshaper.com WordPress PROTIP: Child Themes http://ottopress.com/2010/wordpress-protip-child-themes Replacing a filter in a Twenty Twelve Child Theme http://mikelittle.org/replacing-a-filter-in-a-twenty-twelve- child-theme/ Creating Grandchild Themes http://docs.appthemes.com/tutorials/creating-grandchild- themes/
  47. 47. Credits Fonts Arvo & Lato Photos Flickr – Creative Commons Cat photos – K. "Crazy Cat Lady" Presner
  48. 48. Where to find Presentation slideshare.net/zoonini Kathryn Presner kpresner.com Twitter: @zoonini

×