This is the eighth in a series of live lessons on using WordPress and Thesis as a Content Management System (CMS). In this case study we are creating a community news site. Here we discuss how to enable the Thesis meta in the custom post types in the community new website. Thesis meta enables the Thesis post options such as SEO Details and Additional Style.
There are a couple of things I want to do about this Community News site. The first one is to go back over the 8th part of the lesson which is something that I haven’t… I thought I had recorded but evidently failed to do so and that was the part of the lesson that talked about the code that gave the custom post types the Thesis meta information and so just to remind you, I’m going to go back over here. I trust everybody can hear me okay, I think I’ve got this sound set up right but not absolutely certain it’s working the way I like it to be.
So we call those post options we say that we are going to do a new set of these Thesis post options and then we want to talk about the post options, the meta boxes that are part of those post options. And then so for each meta boxes inside of post options, we’re going to create a meta box in this custom post type so it’s add meta box and then these are Thesis specific stuff meta box id, meta box title, so on and so forth. Meta name, the part here that’s important to know is this is where you put the name of your custom post type. And so this custom post type here was Seattle and this one was Edmonds and so this is the function that adds those Thesis meta boxes to the custom type Seattle and Edmonds. And then, the interesting thing about this is that we… first we add action to the hook which is the save post hook and in that save post hook, we are adding this array – Thesis post options and save meta are both functions in Thesis that have already been defined and so we’re just refreshing them or reusing them. And then finally, we’ve got this final add action and that add action is adding to the admin_init hook and this is where we are calling our function here, Thesis for custom post types. So this sort of introduces 2 other hooks, these are WordPress hooks – save post and admin_init and then the Thesis post options and save meta are 2 Thesis functions that are defined elsewhere in Thesis and they’ re essentially the same thing as this. It’s a function like that.
Okay so anyway, this is what we did in order to make that show up the way we wanted it to show up.