In this session we demonstrate how to use the Types plugin to add custom post meta to a Thesis 2 template as a way of creating custom post meta and displaying that custom post meta in any Thesis post or page.
You know there’s another way to add post meta. And I mean the easy way, the way this post meta was made is that the post meta was created by writing in here new custom field. So you create a new… you add a custom field and then you give it a date and stuff like that. I mean, you give it a name and a value. That’s one way of adding a custom field like this.
However, you might want to in fact put it in the form of a form in here. And so you can do this very same thing with something like the Types plugin. If we… over here in Thesis test 2, if we go to plugins, add new and search for Types… if we install that now then we can just click on new custom fields. And I don’t know, I suppose we can say product information. And then we’ll add a single line… that’s not what we wanted. We’ll add a single line to the field and the single line is going to be called price, product price. This value can have… the field can only have one value. We’re not going to make it required. And then we’ll add another one and again, the same way. Let’s see, another single line and this one, this single line will be called author and author. And this can only have one value and hit save and then save the whole thing.
And then if we come over to say one of our posts… well, let’s just do it on a page just to set up to happen to everything. So let’s go to our carousel page for a second. Okay, we scroll down here far enough, organize will show up. We’ll get to this thing that we created. So the product price will say $30 and the author name is Laura Nugent. And I want to show my custom fields so we’ll hit update. And now if we scroll down to our custom fields, you can see the name of the author is wp cf author and the name of the price is wp cf price.
And so now, we are going to add that plugin again. Oh, it’s not a plugin is it? I’m sorry. We’re going to add the box and we’re going to upload this box and we’ll activate it. You can see I have a whole bunch of boxes here that are not activated. Come back over to the skin editor. Let’s get rid of those.
And then if we come back over to HTML and we look at a page… and what we can do is add our simple post meta field. Call this one price, add the box. We’re going to drag that up into the single post box. Remember that was wp cf price, right? So just copy that name, price. Do the same thing with author. We’ll just grab wp cf author from there. Drag that up, save the template.
Now if we view this page, here’s our price. Here’s our author name. You know, I thought I got rid of that. Evidently, I did not. Okay, there’s the author name. Here’s our price.
Okay so this is a way that you can very easily create custom post meta and then display that custom post meta in your… in any Thesis post or page.