Help Center

How to Create an Archive Template to Display the Search Results

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.

Archive templates are intended for displaying sorted, filtered, or searched dynamic content as CPTs, groups of categories, posts, tags, terms, and more. Therefore, archive templates are widely used in online shops, particularly for displaying WooCommerce products. This tutorial explains using the JetThemeCore plugin to create different archive pages and set their visibility conditions.

Creating Archive Templates

To create an archive template, navigate to the WordPress Dashboard > Crocoblock > Theme Templates. Press the “Add New” button to create a new archive template.

add new archive template

To select the settings of the archive template, press the “Add New” button. It activates the pop-up window with the following fields:

create template pop-up
  • Template Type drop-down menu to choose the Archive type of the created template from the Page, Header, Footer, Archive, and Single types;
  • Template Content Type drop-down menu to choose the Elementor or Block Editor for further usage;
  • Template Name field to type the name.

Specify the necessary options and press the “Create Template” button.

Then users will proceed to the selected editor.

Displaying the Search Results in Elementor

Users can apply any available widget to display the search results; for instance, the Listing Grid, Filters, Search widgets, etc. 

use as archive button toggle in elementor

To apply the archive settings to the widget, move the Use as Archive Template toggle.

Click the “Update” button and return to the WordPress Dashboard > Crocoblock > Theme Templates.

Displaying the Search Results in Gutenberg

To display the search results in Gutenberg, add the Listing Grid block. Users can add other blocks for better usability of the page. Initially, select a Listing and then adjust the following settings.

use as archive button toggle in the block editor

Image Source: A Gateway to Countries and Nations of the World

Enable the Use as Archive Template option to make the block inherit the archive settings.

Save the draft and publish the page.

Conditions Settings

The JetThemeCore plugin allows setting flexible multi-conditions configurations for each archive template. 

To set the conditions of the template, navigate to WordPress Dashboard > Crocoblock > Theme Builder.

Select the archive template and unroll the settings tab of the appropriate archive template (the vertical ellipsis icon). Press the Edit Conditions tab.

edit conditions tab

The JetThemeCore plugin applies advanced conditions as follows:

  • Include or Exclude conditions to enable or disable the template;
  • the drop-down menu to select where to show the template: Entire, Singular, Archive, and Advanced.

The Entire option, if enabled, displays the template on all site pages.

include and exclude template visibility conditions settings

The Singular option, if enabled, allows selecting a page to display the archive template, i.e., Front Page, Page, and more.

singular option of visibility conditions settings

The Archive option, if enabled, displays the template on the specified template page(s).

archive option of visibility conditions settingse

The Advanced option, if enabled, allows typing an URL Parameter and value in the field; or selecting a Device for displaying the template: Mobile, Tablet, and Desktop, and assigning Roles to make the template visible or not for the current users.

advanced option of visibility conditions settings

Press the “+Add Condition” button to add new conditions. The Relation Type drop-down menu allows selecting the Or/And relation. 

adding multi conditionse

Conditions for all templates are displayed on the Crocoblock >Theme Templates.

Users can edit the Conditions of any archive page here or back to  Crocoblock > Theme Builder if necessary.

theme parts conditions editing

That’s all about the creation of archive templates.

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.