Inicio - Documentación - POM Theme - 08 Templates - Archive templates

Archive templates

An archive template owns the outer HTML of a supported WordPress post, custom post type or WooCommerce archive. It can combine archive information, taxonomy-term information, shortcodes and the result loop.

Create and assign an archive template

Create templates under Settings → POM Theme → Templates → HMTL templates → Archive HTML templates. Complete Template name, Template HTML and any required stylesheet or script selections.

Assign the result under:

  • Settings → POM Theme → Templates → Blog → Post archive, using Sidebar layout.
  • The relevant custom post type archive tab in Settings → POM Theme → Templates, using Archive layout.
  • Settings → POM Theme → E-Commerce → Storefront → Product archives, using Archive layout.

For WordPress post archives such as category, tag and date archives, Sidebar layout includes the built-in sidebar/container choices and the saved archive HTML templates.

Results region

Use {{archive_results}} where entries should be displayed:

<main class="directory">
    {{archive_results}}
</main>

The archive's Results wrapper controls the loop arrangement. Its Custom result template controls the HTML repeated for each entry. If {{archive_results}} is omitted, the archive template has no result insertion point.

Archive-wide values

{{archive_title}}

Returns the title for the current archive:

<h1>{{archive_title}}</h1>

{{blogname}}

Returns the current site's title:

<span class="site-name">{{blogname}}</span>

Taxonomy-term values

IDs

{{term_id}} returns the queried term ID.

{{parent_term_id}} returns the parent ID. Its optional fallback accepts current or a numeric value:

<div data-term="{{term_id}}" data-parent="{{parent_term_id fallback="current"}}">

Description and media

<div class="term-description">{{term_description}}</div>
<img src="{{term_thumbnail}}" alt="{{archive_title}}">
<section style="background-image:url('{{term_bg_image}}')"></section>

{{term_thumbnail}} and {{term_bg_image}} return URLs, not complete image elements. Product category thumbnails use the corresponding WooCommerce term image; other supported taxonomies use their POM term media.

Color

{{term_color}} returns the color selected for the term:

<span class="term-swatch" style="background-color:{{term_color}}"></span>

These tags return no value when the current archive or term does not provide the requested data.

Icons and translated text

{{icon family="feather" name="sliders"}}
{{translatable_string text=%%Filter results%%}}

family and name identify the icon. text supplies the label sent through the active translation integration where supported.

Shortcodes

Shortcodes in the saved archive HTML are processed after archive merge tags. This allows a shortcode to receive a resolved term or translated value:

[web_offcanvas_content title="{{translatable_string text=%%Filters%%}}"]

Use only shortcodes supported by the active theme and plugins.

Complete example

<header class="catalog-hero" style="background-image:url('{{term_bg_image}}')">
    <div class="container">
        <p class="catalog-site">{{blogname}}</p>
        <h1>{{archive_title}}</h1>
        <div class="catalog-description">{{term_description}}</div>
    </div>
</header>

<div class="catalog-toolbar">
    {{icon family="feather" name="sliders"}}
    <span>{{translatable_string text=%%Available results%%}}</span>
</div>

<main class="catalog-results">
    {{archive_results}}
</main>

Limits

  • Archive templates do not support {{if}} blocks.
  • Feed item tags such as {{excerpt}} and {{featured_image}} belong in the selected feed template.
  • Single tags such as {{content}} and {{posts_nav}} belong in a single template.
  • {{archive_results}} should normally appear once.

Related guides