Help Center

How to Create an Archive Template for a Custom Post Type

This tutorial will show how to create a Custom Post Type Archive template with the help of the WordPress JetEngine and JetThemeCore plugins.

Before you start, check the tutorial requirements:

Managing the Custom Post Types with the JetEngine WordPress plugin is handy. However, you will need an archive template to show the resulting grid. This tutorial will focus on creating an archive template for CPTs using the WordPress JetThemeCore plugin and page builders, such as Elementor and Gutenberg.

Creating an Archive Template

Navigate to WordPress Dashboard > Crocoblock > Theme Builder, scroll down to the “All Archives” (“Jobs (Vacancies) CPT” in this tutorial), and click the plus-shaped icon.

template builder page

In the newly opened pop-up, the template conditions should be set up. 

Pick the “Include” option in the first drop-down, then move to the second, where the “Archive” option should be selected. In the next dropdown, select the “All CPT Name Archives” (for this case, it is “All Jobs (Vacancies) Archives”).

conditions for the archive template

Click the “Create” button. 

We are redirected to the page with the newly created template. Type the name for the template. 

Then click the “+” icon next to the “Overwrite theme body” input and select the “Create Template” option. You can choose a template from the library if you have one, but we will guide you through a step-by-step process for creating one.

Set Up an Archive Template in Elementor

Once you have clicked the “Create Template” option, a new pop-up will appear. Choose the “Elementor” option for the Template content type, and enter the Template name. Then, click the “Create” button. 

create template popup

After that, you get the Template created pop-up, where you can choose to set it up now or later. In this case, we click the “Go to editor” button. 

template created popup

In the template editor, add the Listing Grid widget, customize it, and create a layout and design that suits your needs.

listing grid widget added to the elementor template

The Use as Archive Template toggle in the Listing Grid allows you to pull the number of posts to be displayed on the archive page from the default query. Enable this option to exclude the Listing Grid query settings.

use as archive template toggle for the widget

Otherwise, you can set up a custom query in the Query Builder and apply it in the Custom Query tab. 

custom query applied to the listing grid widget

You can also add filters, search bars, advertising banners, and any other widgets to the template. Click the “Publish” button once you are ready.

Set Up an Archive Template in Gutenberg

When you choose the “Create Template” option, a new pop-up will appear. Select the “Block Editor” option for the Template Content Type, and type in the Template Name. Click the “Create” button. 

create gutenberg template popup

In the Template created pop-up, click the “Go to editor” button.

Now, on the template-editing page, add the Listing Grid block. Select the required Listing Template and configure the block settings as needed. 

listing grid block to the gutenberg template

You can synchronize the number of posts on your archive page with the default query by turning on the Use as Archive Template toggle within the Listing Grid. It ensures that the Listing Grid‘s specific query settings are ignored.

use as archive template toggle for the block

If you need to specify which posts to show, use the Query Builder. Your custom Posts Query can be applied in the Custom Query section. 

custom query applied to the listing grid block

Furthermore, you can incorporate filters, search functions, promotional banners, and other widgets into the template. Hit the “Save” button when finished.

Once the main body of the archive is set, you can add a custom header and footer on the Theme Builder page. Alternatively, you can keep the theme header and footer. 

On WordPress Dashboard > Crocoblock > Theme Builder > CPT Archive, you can create a new template or add an existing one from the library.

add header to the archive template

In this case, we add the already existing header and footer to the archive template. The changes are saved automatically.

header and footer added to the template

That’s it. Now you know how to create a CPT archive template using the WordPress JetEngine and JetThemeCore plugins.

Was this article helpful?
YesNo

Need help?

Ask Facebook community

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

Start a live chat

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