Build Your Own Business Website header image

How to Create a Custom Post Type and Display it in Thesis 2.1

Difficulty Level -

Filed Under Topics - , ,

Listed Under Lesson Subjects -

Applies to -

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.

In this session we demonstrate how to create a custom post type and display it in Thesis 2.1 with customization from the advance level options. We talk about how Thesis automatically creates a Testimonials Archive Page which behaves exactly like a post page that shows all the testimonials on the basis of a single post type template and the archive template. We also show an example of a site with testimonials as custom post type which displays a number of testimonials with different custom taxonomies.

Video Transcript

Rick: Okay, so your next question was, “How to create a custom post type?”

Member: Right. So that’s what I’m using custom post type ui and you’ve created a custom post type and you want to bring that post type into one of the pages in Thesis. How would that be done?

Rick: Okay well, so we do actually let’s see, do I? Oh, I guess I don’t here. Okay, so let’s see let’s go to Plugins and let’s… oh, I don’t even have Custom Post Type UI installed here. Okay, let’s add new. You see, it’s extremely easy in fact, it happens automatically for you.

Member: That sounds awesome.

Rick: So if we install that, okay and then we want to create our own custom post type called Testimonials here. So we go into the UI and we’re going to add a new custom post type and we’ll just call it Testimonials and give it a label “Testimonials” and singular Testimonial and then we’re going to open up our Advanced Options and public will be true, show UI is true, has archive is going to be true, exclude from search is false, capability type post is fine, hierarchical false is fine, rewrite true, with front, query var. Okay, it’s going to support the title, the editor, excerpt, okay about trackbacks, custom fields, let’s just say we’re not going to have comments on Testimonials so we turn off comments, we’ll turn off author and we’ll turn off post formats and just call that good, we create a custom post type.

Member: Okay.

Rick: And then now you can see the Testimonials are over here.

Member: Okay.

Rick: We don’t have any testimonials so if we just add one. Okay, now if we view this testimonial, notice that the template that it’s using is the testimonial template. Now you didn’t create that template, Thesis automatically created this template from the single template. Okay, Testimonials page this is the one that we did manually but WordPress and Thesis also automatically creates a Testimonial Archive page or Custom Post Type Archive page called Testimonials which behaves exactly like a Post page. It shows you all your latest testimonials or yes, it shows all the way the testimonials and so if you’re looking at the and it’s…

Member: And if I wanted to edit…

Rick: It’s created this testimonials template so…

Member: Okay, awesome.

Rick: So here you have a single template and that’s the testimonial template and then under your archive, you have the Custom Post Type Archive page which is called Testimonials.

Member: Beautiful.

Rick: Okay, so those are automatically created for you and they’re created from the basis of the single post type template and then the archive template.

Member: Pretty powerful.

Rick: It’s very very powerful and I don’t know how complex you are planning on getting with this but we have a member who’s taking full advantage of this power, and we have post types here. Well he has hundreds of testimonials and his testimonials are custom post type and we have added a custom taxonomy for those post types for both languages in which the testimonial is given. So you can French Language Client Testimonials so this custom, we’re displaying on this page a bunch of testimonials that were given by clients in the French language and then if we look at those testimonials we can see that there are testimonials for clients by sector which is another custom taxonomy we created.

Member: Okay.

Rick: And testimonials by language and testimonials by service type and so we have all these different ways of displaying this very complex content whether it’s by sector, by language or by service type and all of the facility necessary for doing that exists in Thesis and then I’ve created a number of boxes that you can use to assist that like the related posts query box. I mean that’s what all these are, these are related posts in fact, so is this actually, this little opt-in box. This opt-in box, the opt-in is actually a post type and so we have 2 posts in that post type.

We have the Translation Without Tears opt-in box and we have the Interpretation Without Tears opt-in box and based on the setting of each page, we tell every page, every post, every testimonial whether it’s about interpreting or translating and then we use this related post query box to display the related opt-in so people are only interested in interpreting then when they’re looking at interpreting like here are Interpreting Clients, right. This is again that related post query box and if they look at these interpreting testimonials, here’s Interpreting Without Tears and yet if you go to you know, another one, this one was actually about translation and so now you have the Translation Without Tears instead. So Thesis’ ability to harness custom post types and custom taxonomies and then a couple of handy boxes that I’ve created make it very easy to create very powerful content management systems.

Member: Very impressive.

Rick: And it’s all yours now.

Member: Thank you very much Rick.

Rick: You’re welcome so anything else?

Member: I think that’s it for now.

0 Comments… add one

Save $200 on Membership Now!

Start learning today for as little as
$0.82 PER DAY!
Subscription Options
0 comments… add one