Build Your Own Business Website header image

Community Library Website – Case Study Part 2 – Create Custom Post Types

Whoops, you've found some premium content!

Watch the opening clip of this video to preview it,
the full video is available to paid members.

This is the second 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 site. We are using custom post types for different types of content. We have determined that we will have 2 additional types of content, books (or media) and book reviews. We will now create 2 new custom post types, 1 for media and 1 for book reviews using the Custom Post Type UI plugin.

Video Transcripts

Rick: Okay so I’ve created a community library site here for the purpose of doing this and it’s in WordPress 3.1 and I’ve installed Thesis on it and give it a little bit of styling. But right now, it’s simply a blog in a blog configuration. And since that’s what Pam’s site is, I guess we’ll just keep it that way. But what we have to do now is we need to add the various post types. And so the way we do that is we do that with a plugin. I mean there are other ways to do this but the plugin at this point is quite easy. And so we’ll stick with the easy for the moment.

The interesting thing about this, the easy nature of this plugin is that once we use the plugin, even if we deactivate it, it’s still going to work properly because the plugin is simply creating the basic WordPress… some basic WordPress functionality that WordPress saves even if the plugin isn’t there.

So anyway, here we go. We are going to look at for custom post UI… I think that’s what’s it’s called. Custom fields… it must be custom post type. And you know, maybe I didn’t do a UI, maybe that’s UL, custom post type UI. Yeah, there it is, that’s it. So we’re going to go ahead and install… well, actually we better look at this just to make sure this is the one. Yeah, compatible up to WordPress 3.1 so we’re going to go ahead and install custom post type UI and we’re going to activate the plugin. And then we’re going to come down and look at our custom post types. Oh, very nice. So this has undergone a little bit of revision. I will say while I’m sitting here that this is, without question, the very best, most detailed book on programming for WordPress. And it is by no means, the beginners’ book but it’s everything that you know, these books have professed to teach you how to program for WordPress aren’t. It’s a very excellent book. Pardon me. And this one has just come out and I’m on the verge of buying it so I’m guessing that this is also excellent.
But anyway, I’m going to scroll down here to… well, we’ve added it… oh, I see.,.add new.

Okay so we’re just going to create some post types. So the first post type we’re going to create is going to be book review. Let’s see… book review. Now this is its title or its… oh no. That’s not true. This is its post name so I’m actually just going to abbreviate that to review. And the label is going to be… I don’t know… the label is going to be… let’s just call it… well, let’s call it book reviews for the moment. And then it’s going to be add to review and let’s open up the advanced options here for a moment. Let’s see, okay the description here is just going to be… this is a post type for book reviews… for reviews of library materials. And we are going to let’s see, I think at this point we’re just going to go ahead and create the custom post type.

And then if we come over here and look at Manage Post Types, here is review and if we look over here, we’ve got book reviews and this is add review. And if we open up book reviews, there is nothing in there yet. Add review, here’s our first thing. You can see it does not have the Thesis elements to it yet and so, let’s go back to custom post types for a second. Let’s just dress this up a little bit, manage the post type, let’s edit it and let’s do the advanced label options and let’s say add new review. Let’s see what happens when we do that for a second. This is a way of us just kind of manipulating the information as it comes out so we can see what it looks like. Yeah, see now it says “Add new review”.

Okay so we’ve got… I know we’ve got media. Let’s go ahead and add media to that. So we’ll come down here to additional custom post type, we’re just going to add new and we are going to add the new one, this time it’s… we’ll just call it media, I guess, for the lack of a better term. And we’ll call it media and this is for book, audiobook, DVD, and other media listings. Okay and then let’s just create that custom post type as well.

So here we have…it is nicely added for us, book reviews and media to our list over here and it’s going to behave in much the same way as posts do. Now since we’re coming to our end here, I’m going to save adding the custom taxonomies because that’s a longer conversation. So I’m going to save adding the custom taxonomies to our future… to next week’s lesson. But it’s probably worthwhile you know, doing a little reading about this and then we will take these custom taxonomies and then we’ll create those. And then we’ll create some custom post meta and then we’ll start piling data into this and we’ll just take it from there. So let’s see, Pam do you have any final questions about this before we close today?

Pam: No. This is great. You’re right on target and I’m following you and I just think this is so helpful. I will go and play around with this a little bit now with the plugin and be ready for what you have to say next on the subject.

Rick: Well and you know, what we’re doing here is cutting edge, right? We are right on the bleeding edge of what WordPress really is capable of doing. And so you know, we’re going to amaze everybody when we’re finished with this because this ability has been in WordPress for a while but there hasn’t been as much experimentation with how to apply it as we are going to do here. And I think we’ll be pretty pleased with it.

Pam: It’s so much fun to be amazing.

Rick: Isn’t it just?

0 Comments… add one

Save $200 on Membership Now!

Start learning today for as little as
$0.82 PER DAY!
THIS IS A LIMITED TIME OFFER!
Subscription Options
0 comments… add one

Leave a Comment