Join Carrie Dils for an in-depth discussion in this video The core of the Genesis framework, part of WordPress Themes: Customizing Themes with Genesis.
- [Instructor] Depending on your exposure to WordPress, or programming in general, hearing the words theme framework might sound mysterious or scary. On the contrary though, it's actually pretty straight forward and approachable. So, before we talk about customizing themes built on the Genesis framework, I want to spend a little bit of time talking about the framework itself. Nick Croft, one of the core contributors to the Genesis framework, describes it like this, "Think of the Genesis framework like legos. It has a platform that the various pieces fit onto and those pieces can be moved or removed.
Like legos, some pieces have to fit in certain places, while other pieces can be added almost anywhere." So the basic platform, the Genesis framework, should not be altered. So, let's take a little bit of a tour. So what I've got here is my code editor and we're looking at the insides of the Genesis framework. Now if you downloaded the Genesis framework from StudioPress, unzipped it, and opened it up on your code editor, this is what it would look like. The very first thing I want to show you is in this lib, or library folder and that's framework.php.
Around line 22 here, we've got this Genesis function. Now I say around line 22 because I'm working with Genesis 2.5.2 for this course, but if you're working on a more recent version, your line numbers might not match up exactly with mine through the course. So, here we've got this function, Genesis and it's called in nearly every standard template file within the Genesis framework. Whenever that function is called, all of this code gets loaded. So that's the guts, so to speak.
We're calling in the header, we've got this do action, we've got some markup. Much more of those do actions which are hooks, and then this get footer. We're going to be talking a lot about hooks in this course. For now let's take a peak at what's inside all of these folders. First we've got config and that's simply a file that outputs the names of the contributors to the Genesis framework. Next we've got images. There's not really much, just a logo and a favicon. Then in the lib folder, we've sort of got the guts of the framework.
We've got the admin folder which contains all the code that you would see in your WordPress admin area for Genesis. So, like your SEO settings, your archive settings, your menus, et cetera. So in this admin folder we've got the code that controls all of the admin settings in our WordPress admin area for Genesis. And classes, we've got the various classes used in the framework. We've got our styles here in the css folder. We've got functions that are called at various points in the framework.
And last but not least, we've got this widgets folder that contains the code for the widgets that come baked into the framework. As we continue, we'll be doing a deeper dive into the structure.
- Setting the stage for your customization
- Selecting a child theme to customize
- The core of the Genesis framework
- Child theme template structure
- Action hooks and filters in WordPress and Genesis
- Editing theme files
- Editing the style sheet
- Working with functions
- Adding a custom header image
- Registering a widget area