Inicio - Documentación - POM AI - 22 MCP - Resources - `pom://theme/templates/single`: one-item presentation guide

pom://theme/templates/single: one-item presentation guide

This Markdown resource explains how POM Theme renders one post, product, or custom post type item through a single template.

Build around one current object

Single templates can use identity and content values such as the title, permalink, excerpt, main content, featured image, post ID, navigation, gallery, and custom-field output. They also support conditional blocks based on post meta.

<article class="entry">
    <h1>{{title}}</h1>
    {{if meta="subtitle" value="not_empty"}}
        <p>{{meta name="subtitle" only_content="true"}}</p>
    {{else}}
        <p>{{translatable_string text=%%No subtitle available.%%}}</p>
    {{/if}}
    {{content}}
</article>

Use the structured single merge-tag resource for the current supported names. Do not assume that a feed tag has the same name here; for example, the single context uses its own content contract.

Validation and empty states

Conditions must be balanced, and field names must match real stored meta keys. Test at least one populated object and one object missing optional media or fields. The main content tag supports its documented fallback, while password-protected content continues to follow WordPress protection.

The safe sequence is schema → merge tags → guide → markup validation → dry-run upsert → save → separate assignment. A template being saved does not automatically assign it to a post type.

Related guides: single merge tags, create a single template, and single template tool workflow.