Post Items
When you add a post, it’s technically called a post item. A page is also considered a post item. Same goes for an attachment (media). A post item is what WordPress calls any content item, regardless of its post type.
Post Types
A post type is a grouping of post items that share similar properties.
Posts, Pages, and Menus are core post types. All posts have boxes for “Categories” and “Tags”, and all pages have boxes for “Template” and “Parent Page”. Post types allow for better organization of content throughout your site.
You can also create custom post types. Some plugins register their own post types too. For example, Glossary uses a "Glossary" post type for storing its terms and definitions.
In addition to the defualt post types we have also added the following custom post types:
- Key Readings
- Oral Histories
- Meeting Minutes
- Exhibits
- Timeline Events
Note: Since we have configured WordPress to use custom post types, we have removed the default 'Post' post type from the Admin menu.
Creating a custom post type
WordPress provides a register_post_type function that you could use to create a custom post type. This code could go either into the theme’s functions.php file, or into a custom plugin. We have configured the current custom post types into functions/custom-post-types.php
You could also use the Custom Post Type UI plugin to visually create new post types.
Taxonomies
A taxonomy is used as a way to describe or organize your post items.
A taxonomy consists of terms. For example, a taxonomy named “Meal Type” would contain terms like “Breakfast”, “Lunch”, and “Dinner”.
WordPress core includes 2 taxonomies (“Categories”, and “Tags”) that are attached to the “Posts” post type. When registered, a taxonomy can be associated with one or more post types.
A taxonomy includes built-in listing URLs. For example, you can set it so that /meal-type/dinner/ will show users a listing of Dinner items.
Taxonomy terms can be used for filtering, but not sorting.
In addition to the default taxonomies, we have added the following custom taxonomies:
- Contributors
- Collections
- Years
- Speakers
Note: The Speakers custom taxonomy is only assigned to the Oral Histories custom post type.
Creating a custom taxonomy
Similar to registering post types, WordPress provides a register_taxonomy function that you could use to create a custom taxonomy. This code could go either into the theme’s functions.php file, or into a custom plugin. We have configured the current custom post types into functions/custom-taxonomies.php
You could also use the Custom Post Type UI plugin to visually create new taxonomies.
Fields
By default, when you add a post item, WordPress saves it into two different areas. The first part is the content you add using the post editor. The second part is the information about that particular content. For example, title, author, date, time, and more. This information bit of the post is called metadata. WordPress automatically adds all the required metadata to each post item you create.
You can also create and store your own metadata by using custom fields.
Custom Fields
Custom fields are extra pieces of information that you can attach to post items.
Custom fields do not include built-in listing URLs, but you can both filter and sort by custom fields (unlike with taxonomies).
Long text, text that’s relatively unique (such as SKUs or street names), dates, and numeric values are usually stored as custom fields.
Creating Custom Fields
We recommend using Advanced Custom Fields (ACF). See Advanced Custom Fields to learn how to create and use custom fields.
Adding Posts
In the next section, we will demonstrate how to add new post items.