Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

What is the difference between custom taxonomies and page templates and custom post types?

I think I understand that taxonomy is used to organize data. CPTs are used to give your data a different design.

but can't a template be used instead of CPT? or are they used in combination?

and can't categories be used instead of creating additional taxonomies?

i guess are CPT's and custom taxonomies just tools to make life easier or do they serve a purpose that could not be achieved without them?

I have been creating new templates for any page the needs a different look or any page that uses a specific category. have i been doing this wrong or poorly? instead of having 7 templates should i have 7 CPT's or something like that?

share|improve this question
add comment

3 Answers

up vote 7 down vote accepted

Taxonomies are categorizations of data. Tags are a taxonomy. Categories are another taxonomy. If you are building a movie website and want to show which actors starred in which movie, "Movies" would be a custom taxonomy.

Custom Post Types are really just custom data items. They're stored just like posts and pages, but aren't considered the same thing as a post or a page. In the movie website example above, "Actor" might be a custom post type with a Name, a Biography, and a Headshot as elements.

Custom Page Templates are special files for WordPress that dictate how the content will be laid out on the page. They're used strictly with pages in WordPress, not with posts or custom post types.

Think of it this way:

Types of Data:

  • Posts
  • Pages
  • Menus (yes, these are a custom post type)
  • Custom Post Types

Ways to Structure and Relate Data:

  • Tags
  • Categories
  • Post Formats
  • Custom Taxonomies

Ways to Present Data:

  • Custom Page Template
share|improve this answer
    
Great answer man. Excellent way to explain the differences. I was a little grey on what exactly taxonomies were, and this helped me leaps and bounds. –  Mike Legacy Feb 6 at 15:44
add comment

It's one of the cases of name that is slightly confusing. Think of Custom Post Type as Custom Content Type instead.

Simply put CPT doesn't have to be post at all. Actually the main purpose of CPT is to give an option to build things partially or completely different from generic posts.

Of course you can hack posts to be many things as well, but CPT mechanisms give more controls and more clear distinction between different types of content.

So if you just need different looking page - custom template is absolutely appropriate tool.

share|improve this answer
add comment

categories are a taxonomy, and can be used instead of additional taxonomies. but where additional taxonomies come in is when you need more than just a single means of categorizing things, or you want them separated.

custom post types are for different content types. they not only can be treated differently on the front end, but they are displayed separately and can be handled different on the back end.

if the differences are superficial, then templates is the way to handle things. if they're separate things like a post vs a product vs a person, then custom post types are the way to handle it.

also have a look at post formats for handling different formats on the front end.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.