JetEngine plugin is a set of flexible tools that can make your website more dynamic and let you avoid lots of manual work. The Custom Content Type functionality can help you organize the data on the website more efficiently. However, you may wonder what the difference is between CCT and Custom Post Types. This detailed tutorial will answer that question and describe the process of creating a new Custom Content Type.
Why do you need a CCT?
To explain this, we have to dig a little deeper into the website roots. All websites consist of data. That data is stored on the server in special SQL tables. When the user opens any of the pages or when he/she seeks for some post, WordPress goes through the SQL tables, finds the necessary data, and then displays it. That was a little intro and now let’s get to the point.
When you create a Custom Post Type, the items of that type will still be “posts.” That means that they will be stored in the same SQL table where all posts are gathered. When the user seeks a post, WordPress will have to go through the whole SQL table that contains posts. If you don’t have lots of posts on your website, the delay will be unnoticeable. However, the more CPTs you create – the larger the table and the lower page download speed are.
However, when you create a Custom Content Type, you actually create a new SQL table in your website’s database for it. When the user searches for an item of that content type, WordPress will seek it in a separate table. The items you create won’t clutter the SQL table with posts, and the requests will be performed noticeably faster. Especially if that content type is for data that the user won’t have access to. For example, you can create a Content Type for orders. You don’t need to display that data on the website, you need it for internal use only. That data will be stored in a separate table and won’t slow down the search as it would be if you created a Custom Post Type for orders.
By default, custom content items don’t have personal single pages and can’t be shown on the website otherwise than as a listing grid. However, if you need to display the items of the content type on the single pages, the Content Type can be linked with the Post Type. For example, you are selling books, have created a Books Content Type, and want every book to have a single page for the user to visit it.
In this case, every custom content item will have a corresponding post linked to it. But even now it won’t encumber the SQL table with posts that much because all the metadata of the item will be stored in that SQL table for Custom Content Types and not in the posts table. In either way, the speed of the website won’t be harmed really badly.
To sum up, you will need Custom Content Type functionality if you are going to add a big number of items to your website. A created CCT will keep your website fast and convenient for the user.
How to Create a CCT?
Now, when you are sure you need the Custom Content Type functionality, let’s go through its creation process.
1 Step — Enable the CCT functionality
Go to your WP dashboard and open the JetEngine > JetEngine dashboard. In the Modules tab, find the Custom Content Types checkbox, tick it, and press the “Save” button.
2 Step — Create a CCT
When the saved settings are enabled, the page will reload, and you will see a “Custom Content Types” option in the JetEngine submenu. Proceed to this page.
The table of custom content types will be empty, so hit the “Add New” button.
3 Step — Define settings
The settings menu you can see now consists of three sections. Let’s go through the tools they offer you.
- Name. Here you choose the title of your Custom Content Type;
- Slug. This field is filled automatically from the Name. Slug is a kind of ID that you will need if you would like to use it for some of JetEngine’s dynamic functionalities. You can use only Latin letters here and make sure there are no spaces there – use hyphens or underscores instead;
- DB Table Name. It is how the newly created SQL table will be named in the database. This feature is also created automatically by adding a slug to the “wp_jet_cct_” ID. However, you can change it to some custom name if you want;
- Has Single Page. Turn this toggle on if you want to connect the Custom Content Type with the Custom Post Type. In this case, three more features will appear:
- Related Post Type. You can choose the Custom Post Type to be connected with your CCT from the drop-down menu;
- Title Field. In the Fields settings section, you create fields for your content type. The data from the field you will choose in this drop-down menu will be automatically placed to the Title area of the post. That is why you should choose only the text and number-related fields for this feature;
- Content Field. The information from the field you choose in this drop-down menu will be automatically placed to the Content area of the post. Be aware that only fields, which are filled with text or numbers, will be displayed correctly in the post. The changes you make in the post’s Content area won’t affect the data in the Content Type item field;
- Menu Icon. The Custom Content Type is displayed in the dashboard menu. Here you can choose the icon for it.
By clicking the “New Field” button, you can add as many meta fields to the Custom Content Type item as you want. The fields and all their settings are just the same as the ones added to meta boxes. If you need more details, go through our meta fields creation tutorial.
You can choose what meta fields will be shown as admin columns in the post here. Just turn the Show in the admin columns toggle on. You will be allowed to add Prefix and Suffix and choose if the column Is sortable or not.
When you are done with the settings, hit the “Add Content Type” button. Find the freshly created CCT in the dashboard menu, open it, and start filling it with items. After you click the “Add New” button, the item editing window will look somehow like that:
Custom Content Type Listing Item
The process of Listing Item creation for the CCT is just the same as for the Custom Post Type. It is described in detail in our listing creation tutorial. There are only two sufficient differences there:
1. After clicking the “Add New” button in the JetEngine > Listings menu tab, you have to choose the “Custom Content Type” option in the Listing Source drop-down menu.
2. You have to choose the “Post/Term/User/Object Data” option in the Source drop-down menu of JetEngine’s dynamic widgets. In that case, you will find the Custom Content Type meta fields in the Object Field drop-down list.
Having created a Listing for the CCT, you will be able to create a Listing Grid with it, apply any kind of filters to it, and display it on any page you need.
Congratulations, you’ve learned how to create a Custom Content Type and assign it to the Post Type using JetEngine functionalities.