First, let’s answer the question, “what are WordPress custom post types?”
WordPress can be customized to display nearly any type of content in any way that you like. In WordPress, there are the default Posts and Pages that display content in ways defined by theme settings and plugins. Creating a custom post type allows you to create entirely new content on your site and customize its’ display. Great examples include custom built templates for movie pages, music album pages, sports teams and live events. In this tutorial, I’ll show you how the custom post types are created and how your site can benefit from them.
You can either watch the detailed tutorial below or scroll below that to read the image/text version of the tutorial.
First of all, you’ll need to install a plugin. I recommend the WordPress Custom Post Type UI plugin.
Click on install now and activate and there should be a new icon in the dropdown menu on the left called CPT UI – Custom Post Type User Interface. Here, you’ll see a couple of options which will be explained in this article.
Adding/Editing Post Types
After hovering over the CPT UI plugin menu item, click on ‘Add/Edit Post Types’ button.
On the next page, the first thing you need to do is to add the slug for the post type. Bear in mind that slugs need to be in lowercase in case you’re wondering why does WordPress keep correcting you as you type.
The slug you create will appear in the URL and you’ll have to put in both the plural and the singular label below the slug field.
Click on Add Post Type and voila! You have your own WordPress Custom Post Type which you can edit and customize any way you like.
It even adds your very own left-side menu item in your WordPress dashboard. In the case of this example, it’s called Movies.
Check Out Your New WordPress Custom Post Type
To see your custom post type editor, you have to hover over the newly added menu item on the left on the menu and click on Add New.
It’s nothing special right now, but it will be once we play with a few more settings.
Editing Your Custom Post Type
To add and customize your recently created custom post type, you should go to CPT UI and select ‘Add/Edit Post Types’. Hover over Edit Post Types and you’ll be able to change the post type or post types you’ve created.
You can change the basic things such as singular and plural labels. If you scroll down, the next section is for editing and adding additional labels. This part is very descriptive and simple and the changes are mainly aesthetic.
Where the magic happens is on the section where you choose what types of items are available in the editor of your new custom post type.
I recommend checking all the fields since it’s nice to have your options open. Selecting all these fields will show you everything that is available. Once you know exactly what you want available in the custom post type editor then you can slim down the options.
Customize Your WordPress Menu Icon
You can also change the menu icon by using a WordPress dashicon class (YouTube tutorial here) or an image URL. The icon needs be exactly 20px by 20px.
To find a dashicon go to the Dashicon Website and click on one you like.
*Class name is highlighted.
Then copy the class name and paste it into the menu icon input field of your CPTUI plugin settings.
When you click on save post type, the icon in the menu should change.
WordPress gives you the option of using built-in taxonomies: categories and tags. You can also create your own taxonomies using the CTP UI plugin.
The process of adding taxonomies is very similar to adding custom post types since you have to add the taxonomy slug and both the singular and plural labels.
However, make sure you associate the taxonomy you’ve created with the appropriate custom post type.
After you click on add taxonomy, you can edit it, add labels and change the settings as you did with the custom post type. The main difference is the lack of advanced editor settings because those do not apply to taxonomies. The new taxonomy is in this case called Genres.
Your new taxonomy should appear when you hover onto the custom post type mneu item (in this case Movies). Click on Genre and add as many genres as you like.
You can see the Add New Genre page above.
Here you can add genres on the left side and see existing Genres on the right.
You can have as many custom post types as you want.
For a regular user, you should have a maximum of 5 custom post types in order to keep your WordPress admin well-organized and readable. In a future tutorial I will show you, in detail, how to use the Advanced Custom Fields plugin to create complete custom page temples for your WordPress site.
For customizing your WordPress site further, make sure you subscribe to my WordPress Tutorials – WPLearningLab channel and click on the bell notification not to miss any of the useful WordPress tutorials.