2014-02-06



A guest post from Carrie Dils.

It started with preparations for a grand birthday fiesta of a powerful, local military leader. Women swooned, men followed, and enemies feared.

But all of the sudden it turned into a vocabulary lesson.

The teacher? El Guapo. His audience? Poor Jefe and anyone who’s ever watched ¡Three Amigos!, a 1986 spoof on a Western adventure, and the reason I now use the word plethora as often as possible.

If you’ve not seen it (or it’s been 20 years and you need a refresher), here’s El Guapo’s English lesson:

Jefe: I have put many beautiful pinatas in the storeroom, each of them filled with little surprises.

El Guapo: Many pinatas?

Jefe: Oh yes, many!

El Guapo: Would you say I have a plethora of pinatas?

Jefe: A what?

El Guapo: A *plethora*.

Jefe: Oh yes, you have a plethora.

El Guapo: Jefe, what is a plethora?

Jefe: Why, El Guapo?

El Guapo: Well, you told me I have a plethora. And I just would like to know if you know what a plethora is. I would not like to think that a person would tell someone he has a plethora, and then find out that that person has *no idea* what it means to have a plethora.

Jefe: Forgive me, El Guapo. I know that I, Jefe, do not have your superior intellect and education. But could it be that once again, you are angry at something else, and are looking to take it out on me?

So what is a plethora? A lot. A whole lot of something.

Many Beautiful Posts

Now that we know what a plethora is, let’s talk about what a standard post type is (we’ll get to custom in a second). You already know about Posts and Pages in WordPress, right? Guess what? Those are post types.

They look like this in your dashboard:



These standard post types are part of the default WordPress setup.

If you were to go poking around the database of a WordPress install, you’d find a wp_posts table (it doesn’t have to be prefixed with wp, but that’s default) and you’d see that pages AND posts live there together, in the same table, in beautiful harmony.

The way to tell the difference? There’s a database column labeled post_type and the contents tell you what type of post an entry is. Like this:



With that brief primer on standard post types, let’s talk about custom post types.

Would you say I have a Plethora of Posts?

Custom post types are just like standard posts or pages, except for:

They’re not part of a default WordPress install

You create them as you need them (or, in WordPress vernacular, register them).

Think of custom post types as a way to differentiate types of content on your site. Before I go on, if you’re not sure what the difference is between a post and page, watch this video tutorial that Bob shared here yesterday.

How do you know when you need to create a custom post type as opposed to use the standard post and pages built into WordPress? Well, a good rule of thumb is whether you have (or plan to have) a plethora of posts.

Let’s look at some everyday examples where a custom post type might come in handy:

Books

Movies

Real estate listings

Restaurants

Discographies

Products (nay, Pinatas!)

We could go on and on ’til Bob univited me….

What do these things have in common? They are things, not types of things. Imagine (unlike a category/grouping) that each of things has at least these elements:

Name

Some basic info

Associated image

Like this:

Looks like a regular post or page, right? Yep!

So why not just use regular posts or pages?

Because You have a Plethora of Pinatas

A tipping point for whether to use a custom post type is whether you have a plethora of something. If you only have one pinata, just make it a regular post. On the other hand, if you have a dozen pinatas, maybe it’s time to consider creating a custom post type.

Custom post types have these benefits:

Improve WP admin UI (Better content organization)

Increased efficiency creating content (Want to create add a Pinata? Just go to the Add Pinata section)

Customized display on front end (i.e. Different layout for Pinata posts)

Hide unneeded details (i.e. Don’t show date or post author on front end)

They make you look cool (research pending)

Are you on board with custom post types yet? Let’s look at how to add them to your site

Adding a Custom Post Type to Your Site

How you choose to incorporate custom post types (CPTs) in your site will depend on a couple of factors:

Your comfort level when it comes to code (i.e. Register a post type yourself vs use a plugin)

Future freedom from your theme (i.e. if your CPT is registered in your theme code, what happens when you change themes?)

I don’t think commercial themes should include custom post types. It’s bad form. But if you’re tinkering on your own site, it’s fine to register the CPT as part of your theme, so long as you understand that when you change themes, you’ll need to take that chunk of CPT code with you.

If you want to you use a plugin to create a custom post type, there are plenty of free and premium plugins available, each with a different level of offerings. I won’t digress into a full review of available CPT plugins, but I’ll point out a couple that I’ve used and like:

Custom Post Type UI – Free from the WordPress.org repository. Great way to register and manage your own CPTs.

WP Types and Views – Not free. Beyond just registering and managing CPTs, Types & Views helps with front-end display.

You Have Superior Intellect and Education

Hopefully you know more about custom post types now than you did seven minutes ago. Have questions? Just ask ‘em and I promise that if I’m angry at something else, I will not be like El Guapo and take it out on you.

The post Plethora of Posts: A User-Friendly Introduction to Custom Post Types appeared first on bobwp - Bob Dunn WordPress Trainer.

          

Comments

Hey Mike, yeah, I knew when Carrie said there would be a ... by Bob Dunn

That's exactly how I learned the word “plethora” too and ... by Mike Hale

Thanks for the heads up….fixed! by Bob Dunn

Hey Cliff, that is great to hear. I love when a WordPress dev ... by Bob Dunn

That's about the best introduction to custom post types I have ... by Cliff Ellis

Related Stories

The Differences Between Posts and Pages

Once I Find Your Blog, Don’t Make Me…

How To Choose a WordPress Theme

 

Show more