How to Create Custom Post Types?
Although there are many good plugins for creating custom post type, like Toolset for example, we would explain how to use Custom Post Types using the Custom Post Type UI plugin. This is one of the most popular and easy-to-use plugins for creating custom post types.
CPT UI installation
You can download the Custom Post Type UI plugin from the WordPress directory and install it in the usual way via your WordPress Dashboard – Plugins section.
Adding custom post types
Go to the CPT UI menu and click on “Add/Edit Post Types”. After that just fill the required fields, like:
- Post Type Slug: boats
- Plurar label: Boats
- Singular label: Single Boat
You can make additional settings in “Additional labels” fields, kindly check the CPT UI documentation
Note: As you would like to have custom single posts and archives accessible on the frontend of your website, in the settings please ensure, that the “Public” setting is set to TRUE
Scroll down to the “Support” section and select the post fields which should be included in your custom post type like:
- Featured Image
- Post Formats
After that click “Add post type” button to save your changes. The new label “Boats” appears in the WordPress left menu
Adding custom taxonomy
Let’s say you wish to group your boats according to their types like motorboats, yachts, catamarans etc. It would be helpful to have a kind of “Boat Types” categories so you can assign each boat to the respective boat type. To do this you need to create a custom taxonomy “Boat Types” in the following way:
In CPT UI plugin menu click “Add/Edit Taxonomies”. Now you can start filling the required fields:
- Taxonomy Slug: boat-types
- Plural Label: Boat Types
- Singular Label: Boat Type
- Attach to Post Type: here you need to assign this custom taxonomy to your “Boats” post type by activating the respective checkbox
After that simply click “Add Taxonomy”. In the WordPress menu under the “Boats” item you will see the menu submenu – Boat Types
Great, now you have created your own unique custom post type!