This is the ninth 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 library website. In this lesson we create our custom post meta. We use the plugin Verve Meta Boxes to create and configure our post meta. We are creating a meta box that will capture all catalog item information.
The Verve Meta Box Plugin is no longer available. As a replacement we are suggesting the Types Plugin.
Rick: So anyway, now what we have is all of our… so we got our custom post types set up and we’ve got our custom taxonomy set up. And so now what we need to do set up our custom post meta. And so what we’re going to do for that is we are going to install a new plugin, add new, and to the plugin that we’re going to install is… holy smokes, I’d forgotten what it is. Let’s see, let’s search for custom fields or custom meta boxes. Maybe that was what I should’ve searched for. Yeah, I should have searched for custom meta boxes. Verve meta boxes, that’s what it is. Okay so we’ll go ahead and install Verve meta boxes, activate the plugin and then what we’re going to do now is we’re going to create each one of these elements as a meta box item. And the way that works is actually very simple. That is, if we… let’s see, where is that though? Verve meta boxes is in tools, yeah there it is. Verve meta boxes… and Allen has a very interesting question which is as soon as we’re done with this, we’ll jump on to because I’ve actually worked on the site very recently to answer his question.
Okay so we’re going to create a meta box and this meta box is going to apply to, at the moment, media. And we’re going to call it… what shall we call it? We’ll call it catalog item information. It’s going to have ISBN, barcode, call number, circulation time, and publication year. So yeah, let’s call it catalog item information. We’re going to create the box and so, in this box… let’s see, we could do ISBN, barcode, call number and then publication year and circulation time. So ISBN, barcode, call number… actually, I’m going to bring you back online here for a second, Pam. Pam, do you have a preferred order for this?
Pam: No. At this point, I don’t see any use for a particular order unless it’s the same order that things were in the table.
Rick: Well, what’s going to happen is… no, that doesn’t matter. What’s going to happen is you’ll have one field and then another field and then another field and then another field and then another field. And so if there was you know, for data entry in the future, if there was some benefit of one having priority over the other then we could organize it that way. But if there isn’t, it doesn’t matter.
Pam: Probably, barcode is the one… is the most important then.
Rick: Okay and as we see from that, that’s a single line so we’re just going to call that barcode and the description is going to be… and the description is kind of like an instruction. So do you refer to the barcode as anything other than just barcode?
Pam: No and it’s just one word.
Rick: It’s one word – barcode. Like that, okay.
Rick: So enter the barcode, enter the..yeah, okay. Enter the barcode here. We’ll add that field. Okay and so the next… so what’s the next most important?
Pam: After that, I think it probably doesn’t matter. Maybe, call number.
Pam: Because every item at least those two.
Rick: Okay, call number and…
Pam: So I know when I’m entering new ones, I’ll have to enter those.
Rick: Okay so enter the catalog item’s call number. We’ll add that field and then we’re just going to toss the rest of these in then so I just did call number. I may as well put ISBN, text again…I should have pointed out to you that there is this… you have this you know, a choice of different types of fields. So in this case, we’re going to add ISBN and in the books ISBN, add the field and then publication year and circulation time. Actually, let’s make publication year a date, what do you say? Instead of that so now, publication year and then enter the publication year and then finally, circulation time and enter the length that a borrower can check out a material… add the field.
So Pam asks, “Is there a way to have a default entry?” Yes, there is a way to have a default entry but I think we should not do that. I’m not sure that we can do it here either. Let’s see, if we…oh of course, that is for a tag. No, it’s actually not a way to add a default tag to a post. Oh, radio box would be useful for circulation time. There are only 3 to 4 choices. Okay, well let’s do that then. Let’s edit this and oh, let’s take it out. Okay, radio button, circulation time… that’s cool because we’re going to show you how to do it then. Select the length that item can be checked out. Well anyway, you get the idea here. And then under this now, we’re going to have a choice of entering our various options and the values aren’t yes/no actually. Values are 7 days, 14 days, and library use only. So now I want to edit this. I thought that it would automatically create… let’s see, let’s update the box and then I want this updated and see if we can edit it.
Rick: Okay so Pam, I’m going to unmute you here for a second. Go ahead. You have your hand raised. Did you have your hand raised?
Pam: Oh I did not have my hand raised.
Rick: Oh okay. So well you know, I’m going to have to figure this out. I thought I knew how to do this. I know there is a way for us to do a radio button and I don’t remember how to do that. So next time, I’m going to have to come back on this one. But we’ve got the box created and so if we come over to our catalog and open up one of books like our test book, edit this…we will now have this catalog item information set up for us, right? So have a place to put barcode, a place to put call number, a place to put ISBN and a place to put our publication year. And then what we’re missing here is the right kind of radio button set up and I’m going to do some research and next time we talk about how to do this, we’ll figure out how to set that so that it’s one of our 3 options. It could be also that it’s a drop down instead of a radio. Maybe the radio button in this only works in yes or no. But now we’ve added these things and this is you know, custom post meta. If we say barcode is custom, let’s just say it is for a second and update it, you’re going to see that if we scroll down to the bottom of this, down here under custom fields, you can see now that custom fields have something set under barcode. And circulation automatically has no set for circulation time because of the way this works.
And so that’s relationship between custom post meta and the custom field. You could actually do this entire thing without ever having these little meta boxes. You could just come down here and you could say you know, select a new custom field or you could add a custom field and that would be added and then you could change the value here. But that’s a lot more cumbersome and a lot more for someone to remember than to have this nice thing just sitting right here. And so, that’s what why do it this way. Okay and so that brings to an end, this part of the… well, that brings to an end the conversation about our case study.