Stand with Ukraine. Fight for freedom and democracy

Back to contents

JetThemeCore: How to Create an Archive Template to Display the Search Results



Discover the process of creating the archive template to display the search results with the help of the JetThemeCore plugin.

Tutorial requirements:

So let’s get started and create the archive template with the help of WordPress Block Editor and the JetThemeCore plugin.

Creating an Archive Template

Open the WordPress Dashboard > Crocoblock > Theme Templates screen to look at the theme part templates.

crocoblock theme templates

Click the “Add New” button at the top to create an archive template. In the appeared pop-up, fill in the fields with the required information.

Set the “Archive” option as the Template Type. The following Template Content Type drop-down list is to determine whether you want to create a template by using the “Block Editor” or “Elementor.” 

Also, you can complete the Template Name. Though this field is optional, the template will automatically receive the name if you leave this field empty.

Hit the “Create Template” button to proceed to the editor.

create an archive template

Once the editor is opened, we add the Listing Grid block. Initially, select a Listing and then adjust the following settings.

Ensure you have enabled the Use as Archive Template option to make the block inherit the archive settings.

listing grid in the block editor search template

In case you want to display the publications you have in Elementor, use one of the widgets below:

Depending on the widget you choose, your posts will be displayed with different layouts. Drag-and-drop it on the page, and don’t forget to style it according to your taste and needs.

Make sure to enable the Is Archive Template option for the proper work of the search.

posts in the elementor search template

Once the page is ready, click the “Update” button and return to the WordPress Dashboard > Crocoblock > Theme Templates.

As you can see in the Instances tab next to the newly built template, the conditions are not set yet. So, press the “Edit Conditions” button to make a change.

conditions not selected for search template

Press the “Add Condition” button to establish the new condition.

add condition button in the popup

Beginning with the first selector, pick “Include” as we want to enable the template. The next option to be chosen in the second drop-down menu is “Archive,” and the third one should be defined as “Search Results.”

That’s it for changes, so we push the “Save Conditions” button.

condition for the archive search results template

Now you can notice that the condition is displayed in the Instances tab.

set conditions for search template

That’s enough to create an archive template if you want to display the custom archive when the search results are shown. Now go to the website page where the search is located and type in a keyword in the search field to see how everything works.

search resulta on the frontend

Everything works fine; now, you can easily create an archive template for the search results in Block Editor and Elementor using the JetThemeCore plugin.