This is the seventeenth in a series of live lessons on using WordPress and Thesis as a Content Management System (CMS). We want to add the Thesis post meta boxes to our custom post types. In this session we write the function to add the Thesis post meta to our custom post types.
Oh no it’s not one without an image, we have one last thing we have to do which is add our Thesis post meta to these custom post types because currently, we don’t have that. And we did this in the other case study as well and we’re just going to do that again here with this one. Let’s see, this is… okay, we’re finished with categories and this one here is our… yeah, this is the one we’re working on. And I need to add that custom post meta so I’m going to get the code for that from my custom functions php file because I use the same thing. Okay so this function adds Thesis meta, we’re going to copy that code. Come back over here to the bottom of the custom functions php file for this project and this function adds Thesis post meta to the catalog items post type. So Thesis for custom post types, post options equals new… post options is just a regular form for doing this and then for each of the Thesis post options, cycle through that and then add those to the meta box for each of these. And right here is where we add catalog items. Of course, we have to spell it correctly. Catalog items… okay, let’s just make sure that that is actually the name of our custom post type. So we’re just going to come down to custom post types.
Okay so now, we’ll take a look at our catalog items and now we’ve got all of our catalog items in here. And let’s look at this catalog item and no… we don’t have our custom post meta attached to this yet although it does say Thesis post image. So if we viewed this, oh it does work. Actually, it works fine even though we haven’t attached those post meta boxes to this because it still looks for that information.
So I’m not exactly sure… actually, you know what? Probably the problem was it didn’t upload when I… yeah, it’s not connecting properly. There we go. Thesis_18, custom, custom functions php… our revised one and so if we go to edit this, now we should have all the… no, we still don’t have all the Thesis bits. And yeah, okay so let’s look at our code again. Unless I’ve made a mistake with the… oh no, I didn’t save the silly code. That always happens too. Save it, upload it, test it. There we go, now we get all the Thesis post meta stuff. Perfect, okay.