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

Add theme support options

From the course: WordPress and Genesis: Building Child Themes from Scratch

Start my 1-month free trial

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,…

Contents