- What is a Custom Post Type?
- Creating a Custom Post Type
- Creating the content
Custom Post Type is one of the JetEngine features for organizing your site’s content in a convenient and easy-to-use way for you. . From this tutorial, you will discover what is a CPT, how to create one, and what it can be used for.
What is a Custom Post Type?
The Custom Post Type, also called CPT, is a post type that is different from simple posts. It can have other properties, templates and have its own slug and archive, etc.
For example, you have a website that is specialized in books. All the books have to be posted the same way, with the title, picture, and description. If you would like to show all those books in a grid, you will have to manually add all the information you have already added to the post single pages again.
With the JetEngine you can create a Books CPT and add the “title”, “picture” and “description” meta fields to it. The data you place into the meta fields can be further displayed in a grid automatically without re-entering it. Besides that, you can use it not only in the grid but in any fields that allow dynamic tags.
The posts of a Custom Post Type are gathered and stored in a separate tab of your website’s dashboard, which is very convenient when you need to find something.
Creating a Custom Post Type
1 Step — Add new CPT
Go to the JetEngine > Post Types section on the left-hand menu in your WP Dashboard.
Here you’ll see the Custom Post Types List screen, where all your CPTs will be shown when you will have ones. Click the “Add New” button to create your first CPT.
2 Step — Get along with the settings
Now you should fill in the information that is necessary to indicate your new custom post type.
- Post Type Name. This is the CPT’s title that will be visible in your website’s dashboard;
- Post Type Slug. It is generated automatically from the Name you previously entered. The slug is a post type’s ID that will be used for various purposes;
- “Edit post type/meta box” link. This toggle creates a shortcut from every post editing page of this custom type to the page you are now. If it is enabled, a little gear-shaped icon appears in the right top corner of the meta fields block of a post editing page. When the user clicks is he will land on the Custom Post Type editing page.
As the Custom Post Type is visible in the dashboard, its name will be used for a number of options. In the Labels block, you can choose how the CPT name will be used. For example, instead of the “Add New Item” option, you can choose the “Add New Book” label. Go through the list of labels and change them if necessary.
In the Advanced Settings block there is a set of features that are connected to the CPT displaying on the dashboard:
- Is Public. While this toggle is enabled, the CPT is visible and accessible in the dashboard and can be seen by admins and users;
- Exclude From Search. You can create a CPT that will be used by the admins only. In this case, you can enable this toggle and the posts of this custom type won’t be available for the front end search tools;
- Publicly Queryable. This toggle is connected with the Is Public one. if it is enabled, the queries of this CPT can be performed on the front end;
- Show Admin UI. If you disable this toggle, the tab to edit the posts of custom type will disappear from the dashboard;
- Show in Admin Menu, Show in Naw Menu, Show in Rest API. Those three toggles allow setting the visibility of the CPT more specifically. You can decide to hide the CPT from the admin menu, nav menu, or REST API.
- Register Query Var. If you enable this toggle, it registers a query_var for this CPT;
- Rewrite. If you want to manage the posts of this CPT rewrites – disable this toggle. You can also change the Rewrite Slug that by default is similar to the CPT’s slug and choose if to Rewrite With Front, which means pretending with $front property;
- Capability Type. In this field you define what string will WP use to build capabilities of this CPT;
- Has Archive. Enable this toggle is you want the CPT to have archive posts;
- Hierarchial. if you want to add that posts of this CTP into a website pages hierarchy – turn this toggle on;
- Menu Position. The number you will type in here will be the number of position on which this CPT’s tab will be shown in the dashboard;
- Menu Icon. Each tab of the dashboard has a unique icon. Here you can choose one for your CPT’s tab;
- Supports. From this drop-down menu, you can choose the additional supporting blocks that will be shown on the CPT post’s editor page.
In the Meta Fields block, you can create necessary meta fields for adding extra content to the CPT. These fields can contain any information you need. You should make sure to choose the proper meta field type to use for the custom post (e.g., Media field type will do for adding a thumbnail image, you can display the date and a date picker by setting the Date field type, etc.).To learn more about creating different types of meta fields for the CPT take a look at this tutorial.
The Admin Columns block provides an opportunity to add particular additional admin columns to the custom post type, which will be displayed in the WP Dashboard. You can display post terms, date and use a custom callback for adding needed information in admin columns.
When you’ve completed the new custom post type with all the necessary kinds of fields for your content, click the “Add Post Type” button on the right. Your new CPT should appear on the left in your Dashboard.
Next, navigate to the newly created CPT on the Dashboard and click the “Add New” option (it can be another label if you’ve set the different one in the Settings block).
Creating the content
You can start filling up your post with the content. Here you can see all the blocks we have added on the previous stages: the meta fields, comments, featured images, etc. Take into consideration that you’ll have an opportunity to change your post’s view in Elementor later on.
After your post is ready click the “Publish” button.
Well done! You can click on the permalink to view how you post looks and continue to edit and design it in Elementor. Please, note, that in order to make it possible to edit the new post type in Elementor, you’d need to enable the editor for this post type. Feel free to read more about how to do it here.
Congratulations! Now you know how to create custom post types using JetEngine plugin for Elementor. And if you want to create a custom content type, check out this tutorial. Good luck and stay in touch!