7

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?

3 Answers 3

15

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
2
  • 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. Feb 6, 2014 at 15:44
  • It seems to me, like "actor" and "movie" - would both be their own custom post types and then you'd set their relationships with ACF or another way. But this is in 2011 - so, magic fields was around, but no ACF yet. Mar 14, 2022 at 21:22
0

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.

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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