17
votes

This may be a trivial question, but I'm a little confused about the difference between "Custom Field", "Meta Box", and "Taxonomy" in Wordpress.

For example, if I'm going to create a custom post type called "Movie" with additional fields of "Actor", and "Genre", what would those additional fields be called?

2

2 Answers

34
votes
  • A "meta box" is one of the various draggable and repositionable boxes available on the Post or Page editing screen (among other screens). There are several by default, such as the Formats, Tags, and Category boxes. A plugin can add meta boxes to be used for whatever purpose they need them, and meta boxes can both have information and receive input. Meta boxes can, and are, used for the following things, but they are not limited to that. They basically are user interface pieces. Wrappers for individual sections of the interface on the post editing screens.

  • A "custom field" is another name for what is better called "post metadata". Essentially, it's a key/value storage for posts that can be used by plugins or themes or directly by users for whatever purpose they need it. It can store arbitrary data about a post to be used in various ways. For example, if posts were about products for sale, then a piece of meta information for it might be "price" and "$9.95".

  • A "Taxonomy" is the generic term for a method of grouping posts together. A "category" is a taxonomy. So are "tags". To better explain taxonomy, if I was grouping together cars, then I might have a custom taxonomy called "color" and would group cars as "blue", "red", "black". Then I might also have a different taxonomy called "manufacturer" and group cars as "Ford", "Toyota", "Chevy", etc. The important difference between post-metadata and taxonomies is that with the taxonomy, the grouping itself is the most important thing, while with metadata, the actual value matters. I might want to see a lot of blue cars in a list, but I wouldn't take the value of "blue" and try to do something with it. Whereas with price, I might try to figure out the tax from it, or order the cars from lowest to highest price.

6
votes

Custom Fields and Meta Boxes are essentially the same, they allow you to store extra data/information in the postmeta table in the database. The data is stored in a key/value pair. And are attached to the post or page by id. Using the add_post_meta function.

add_post_meta($ID, 'name_of_data_to_store', 'value_of_that_data');

The key difference is that Custom Fields are native to wordpress so each post/page has them built-in.

But if you want create a Theme Options page you probably will want to use Meta Box to create the same results as Custom Fields provide natively.

For example, if I'm going to create a custom post type called "Movie" with additional fields of "Actor", and "Genre", what would those additional fields be called?

Actor and Genre could be the Taxonomy or ways of grouping items together wordpress by default has a few called Category, Tags, and Link Categories

more information on taxonomies found here.