Inicio - Documentación - POM Theme - 12 Recipes - Build a dynamic archive and single template

Build a dynamic archive and single template

Use this recipe when a post type and its fields already exist, but the collection needs a reusable archive shell, result card, and single-entry layout.

An archive template owns the page around the results. A feed template owns one repeated card. A single template owns one entry page.

Prepare representative content

Publish several entries with short and long titles, images and no image, filled and empty optional fields, multiple taxonomy terms, and enough results to exercise pagination.

Write down the exact field keys used by the content model. Merge tags cannot infer a renamed or misspelled metadata key.

Build the feed card

  1. Go to Settings → POM Theme → Templates → HMTL templates → Feed HTML templates.
  2. Add a named template.
  3. Include a clear title and permalink.
  4. Add the supported image, excerpt, taxonomy, or metadata tags required for comparison.
  5. Add actions only when their destination is valid for every entry.
  6. Save and preview the template with representative content.

Build the single layout

  1. Open Single HTML templates.
  2. Add a named template.
  3. Place {{title}}, {{content}}, media, and supported metadata.
  4. Wrap optional values in a supported {{if ...}} block.
  5. Add {{posts_nav}} only when previous/next navigation helps the collection.
  6. Save and test password-protected and missing-value states where applicable.

Build the archive shell

  1. Open Archive HTML templates.
  2. Add the archive heading and supporting term context.
  3. Place {{archive_results}} exactly where the cards belong.
  4. Save the template.
  5. Open the post type's template settings.
  6. Assign the archive layout, result wrapper, custom result template, and single layout.

Archive tags, feed-item tags, and single-item tags are different contexts. Do not copy a working tag into another template type without checking its reference.

Verify assignments

Open the main post type archive, a taxonomy archive, several single entries, and a no-results state. Confirm assignment priority, cards, links, optional values, sidebar/container layout, pagination, and translated labels.

Related guides