Did you notice that the function
add_theme_support() is being called over and over and over again in the setup? And did you notice that this function requires a key and then a value? I mentioned in the last episode that the final version of this starter theme will load all of the theme supports from a configuration file.
Calling this function repeatedly is redundant and unnecessary. Let’s refactor it to convert the theme to clean, quality coding standard.
In this episode, you will refactor the WordPress theme supports to move the parameters into a local configuration array. Then you’ll loop through the array to call
add_theme_support(). These changes are the next step towards the configuration architecture of the final version of the Genesis starter theme.
Don’t repeat yourself. Don’t repeat yourself. Don’t repeat yourself.
Total Lab Runtime: 03:59:03
- 1 Lab Introductionfree 05:01
- 2 What the Heck is Modularity?free 13:12
- 3 The Why of Clean Codefree 12:47
- 4 Laying Out the Theme's Architecture - Part 1pro 09:04
- 5 Laying Out the Theme's Architecture - Part 2pro 10:34
- 6 Slicing Up the Sample Theme's functions.phppro 06:44
- 7 Initialization Tasks - Theme Constantspro 14:47
- 8 Initialization Tasks - Directory Constantspro 05:49
- 9 Setup Taskspro 38:00
- 10 Refactoring Theme Supportspro 08:01
- 11 Refactoring Image Sizespro 03:52
- 12 Genesis Structural Componentspro 05:10
- 13 Load Assets (Enqueue)pro 05:56
- 14 Theme Customizer Filespro 15:43
- 15 Theme Settings Defaultspro 06:34
- 16 Autoload Modulespro 11:19
- 17 Unregister Default Genesis Callbackspro 00:00
- 18 Test & Wrap it Uppro 06:30