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.
Default result order
For a custom post type, open its tab under Settings → POM Theme → Templates and find Default archive order. Choose Order by and Order direction, then save.
These settings apply to the post type archive and its taxonomy archives, including results inserted with {{archive_results}}. Choose Menu order and Ascending to follow the entries' numeric menu order from lowest to highest. Each entry must already have its intended order assigned; selecting this option does not assign order values.
Leave WordPress default selected to retain the native ordering. A term-specific Archive orderby setting can override the post type default; leave it at Default to inherit the theme setting.
To verify the result, visit a taxonomy archive containing entries with different order values and confirm that their sequence matches those values.
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.
To introduce the results with the category's saved description, place {{term_description}} before {{archive_results}} in the archive HTML. This retains the selected result template and pagination. If the subheader already displays the archive title, do not add another h1 in the template. With Polylang, edit the description on each translated term and verify both archive URLs.
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.