A custom post type is a content type of its own, next to standard posts and pages, for example ‘Vacancies’, ‘Portfolio’ or ‘Reviews’. You can create these via a plugin or by adding code to your theme. This article explains both methods step by step, including tips on fields, display, and common pitfalls.
What is a custom post type?
WordPress includes the post types ‘Posts’, ‘Pages’, ‘Media’ and ‘Menus’ by default. You add a custom post type to logically separate content. Think of a webshop with ‘Products’, a real estate site with ‘Properties’, or a company site with ‘Team members’. Each custom post type gets its own overview in the WordPress dashboard, its own fields, and can be displayed separately on the website.
The advantage is structure: content stays organized, you can use specific templates, and search and archives work separately per type. This makes maintenance easier as a website grows.
Creating a custom post type with a plugin
The fastest and safest method for most users is a plugin, since you don’t need to write any code and settings won’t disappear during a theme update. Well-known plugins include Custom Post Type UI and Pods.
Install the plugin
Go to Plugins > Add New Plugin, search for ‘Custom Post Type UI’, and install and activate the plugin.
Create a new post type
Go to CPT UI > Add/Edit Post Types and enter a name, such as ‘vacancy’. Also set the plural form and the label that appears in the menu.
Check the settings
Decide whether the post type should be publicly visible, whether it gets its own archive page, and which features (such as featured image or editor) are available.
Save and test
Click save. The new post type immediately appears in the WordPress menu. Create a test item and check how it looks on the website.
Creating a custom post type with code
If you’d rather not use an extra plugin, you can register a custom post type via the register_post_type() function. This is usually done in a child theme or your own plugin, so the code is preserved during updates.
Add the following code to functions.php of your (child) theme:
function tandata_vacature_cpt() {