Help Center
How to Create a Single Page Template for Custom Content Type

How to Create a Single Page Template for Custom Content Type

This tutorial explains how to create a Single page template for the Custom Content Type items using the JetEngine and JetThemeCore plugins for WordPress.

Before you start, check the tutorial requirements:

Custom Content Type (CCT) items don’t support Single pages directly. If you need one, we suggest starting with a Custom Post Type (CPT).

If you still want a Single page for your CCT items, you can create a similar CPT and link it to the needed CCT. Then, after adding new CCT items, the related posts will be generated automatically and will have Single pages.

As an example, we will create a Single template for the “Webinars” CCT with the related “Webinars” CPT.

Create a Custom Post Type

First, we need to create a CPT that is similar to the CCT.

Go to WordPress Dashboard > JetEngine > Post Types and press the “Add New” button.

Set the Post Type Name and Post Type Slug fields and press the “Add Post Type” button.

created CPT for CCT

Set up a Custom Content Type

Navigate to the WordPress Dashboard > JetEngine > Custom Content Types tab and press the “Add New” button or open the required CCT settings by clicking the “Edit” action.

Ensure to set the Name and Slug and craft the required custom fields. More details are described in the How to Create Custom Content Type tutorial.

In our case, it’s the “Webinar name” with “TextField type, “Webinar description” with “TextareaField type, “Webinar image” with “MediaField type, “Scheduled date and time” with “DatetimeField type, and “Registration link” with “Text” Field type.

Then, in the General Settings section, enable the Has Single Page toggle and set the required CPT as the Related Post Type.

Also, you can select the CCT’s Title field that will be related to the post title and Content field that will be related to the post content.

Press the “Add/Update Content Type” button.

cct has single page option

Add CCT Items

Head to the CCT tab on the WordPress Dashboard and create several CCT items.

Warning

If you created items before connecting the CPT to CCT, they wouldn’t have related posts and Single pages accordingly. To change it, you can “Clone” all previously created items and “Delete” the old ones. Hence, posts related to the items will be created, and Single pages will be available.

custom content type items

The CCT item editing page includes the Single post section with the “Go to single post” link that redirects to the related post editing page.

go to single post link for the cct item

After items are created, you can proceed to the CPT tab on the WordPress Dashboard to check if posts that repeat the CCT items are added.

posts related to CCT items

The post title and content repeat the text entered into the related item custom fields.

post title and content related to cct items

Create a Listing Template

Create a listing template for the CCT items as described in the How to Create Custom Content Type Listing Template tutorial.

Hit the “gear” button from the upper toolbar to open the Listing Item Settings and unroll the Listing Settings tab. 

Enable the Make listing item clickable toggle and pick the “Permalink” Link source. After clicking a listing item, users will be redirected to the Single page.

Then, publish the Listing template.

make listing item clickable with cct items

Afterward, proceed to any page or template, place the Listing Grid, select the recently created Listing, and save the changes.

listing grid with cct items

Craft a Single Page Template

Now, we will create a Single template for the related CPT to display the CCT item details here.

Proceed to the WordPress Dashboard > Crocoblock > Theme Builder tab and press the “Create new page template” button.

In the Create page template pop-up, push the “+Add Condition” button and choose the “Include,” “Singular,” CPT related to CCT, and “All” options. Then, hit the “Create” button.

creating a single page for CCT

Rename the page template (optional) and click “+ Add body.” Then, press “Create template.”

creating body template for cct

In the Create a template pop-up, select the Template content type, enter the Template name, and press the “Create” button.

create body template for cct

After the template is created, press the “Go to editor” button.

template for cct is created

In the template editing page, place the Dynamic Widgets or Blocks to display the values from the CCT meta fields as you did for the Listing template.

The preview isn’t available, but the result will be shown on the front end.

single body template content for cct items

Publish the template, return to WordPress Dashboard > Crocoblock > Theme Builder, and set the header and footer for the Single page template.

setting header for the single cct page template

Checking the Results

Open the page with Listing Grid on the front end and click one of the items to proceed to its Single page.

listing grid with cct items on the front end

The Single page shows the details of the CCT item as intended.

cct single page on the front end

That’s all. Now you know how to create a Single page template for Custom Content Type items using the JetEngine and JetThemeCore plugins for WordPress.

Was this article helpful?
YesNo

Need help?

Ask Facebook community

Get answers from 22K Crocoblock Community experts from all over the world.

Start a live chat

Ask question to support agent and share its details via chat messages.