From the course: WordPress and Genesis: Building Child Themes from Scratch
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Add theme support options
From the course: WordPress and Genesis: Building Child Themes from Scratch
Add theme support options
- When we created functions.php, we added our DocBlock, loaded the text domain, and then created an empty wrapper for our theme setup functions. Let's go ahead and start filling things in. The first thing we're going to do is define some constants. Constants are like variables in PHP, except they can't be changed by other code. By defining a few constants here, we can utilize them in our child theme later. So let's start with this CHILD_THEME_NAME. That's the constant, and then Scratch is the assigned value. Next, we have our CHILD_THEME_URL, and finally the CHILD_THEME_VERSION. Now if we ever wanted to reference, say, this CHILD_THEME_NAME in our code, we could reference the constant, CHILD_THEME_NAME, instead of the string "Scratch." By defining these things once, it enables us to reference those values in multiple places. This is really nice because if you end up changing a constant's definition later, you can change it in one place versus everywhere it shows up in your code. Next,…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Add theme support options4m 35s
-
Remove Genesis defaults4m 53s
-
Register widget areas4m 28s
-
Challenge: Build out functions.php38s
-
Solution: Build out functions.php30s
-
Set up your front page to check for active widget areas3m 1s
-
Display active widget areas on your front page5m 5s
-
Challenge: Build out front-page.php42s
-
Solution: Build out front-page.php47s
-
-
-
-
-