Custom Post Type

The default user-facing post types in WordPress are page, post and attachment. There are others, but they aren’t exposed to the user in the same way. Custom post types can be used for pretty much anything: recipes, reviews, products, orders, contact forms, words in a glossary… Yes, this page is a post within a custom post type, called wpglossary_word.

By using a custom post type for the glossary words on this site, I could add a blog section to it later using the standard “post” post type, if I wanted to. It also gives me more control over how to structure the words. Different post types can have different features, settings, permalink structures and taxonomies. They can also be displayed differently by the active theme.

Custom post types can be added by both themes and plugins, but it is considered best practice to add custom post types in plugins. This is to prevent you from losing your data when you switch themes.

Leave a comment

The End. Seriously the website is over. Copyright whatever year it is. All rights reserved and such.