Single templates
A single template renders the body for the current post or POM custom post type item. Its merge tags use that item's fields, media and metadata.
Organization authorship in Rank Math
For content written on behalf of the site organization, enable Use organization as schema author under Settings → POM Theme → Templates → Blog → Post single. For a POM custom post type, open its tab under Templates and the corresponding single settings.
Configure the organization in Rank Math first. The setting is disabled by default and applies only to the selected post type. It makes Article, BlogPosting and NewsArticle schema reference Rank Math's existing publisher organization as their author. Without a publisher organization containing an ID and name, the existing author is preserved.
Save, open a published item and inspect its JSON-LD: the article's author should reference the organization's @id. WordPress user accounts, visible bylines and {{author_name}} do not change. Keep the option disabled for content that should identify an individual author.
Conditions
Conditional blocks inspect one custom field:
{{if meta="event_status" value="confirmed"}}
<p>Confirmed</p>
{{else}}
<p>Provisional</p>
{{/if}}
value |
Match |
|---|---|
| An exact value | The saved field equals that value |
empty |
The field has no value |
not_empty |
The field has a value |
Conditions use the same syntax and comparisons as feed templates. They can contain HTML, other merge tags, shortcodes, nested conditions and an optional {{else}} branch. Only the selected branch is rendered. Close every condition with its own {{/if}}.
{{if meta="event_status" value="confirmed"}}
{{if meta="venue" value="not_empty"}}
<p>{{meta name="venue" only_content="true"}}</p>
{{else}}
<p>Venue to be announced.</p>
{{/if}}
{{else}}
<p>Confirmation pending.</p>
{{/if}}
Exact comparisons are case-sensitive. As in feed templates, empty also matches a missing field, zero (0 or "0"), false and an empty array; not_empty matches values that are not empty. Check the result on items with populated and missing fields before publishing.
Main post fields
| Merge tag | Attributes | Result |
|---|---|---|
{{post_id}} |
None | Current post ID |
{{title}} |
None | Title |
{{content}} |
fallback_message |
Full content or the supplied fallback |
{{excerpt}} |
limit |
Plain excerpt, shortened to the character limit |
{{permalink}} |
None | Permalink |
{{date}} |
None | Publish date |
{{modified}} |
None | Modified date |
{{author_name}} |
None | Author display name |
{{posts_nav}} |
None | Previous/next post navigation |
Examples:
<h1>{{title}}</h1>
<p>{{excerpt limit="150"}}</p>
<div class="entry-content">
{{content fallback_message=%%No description is available.%%}}
</div>
{{posts_nav}}
Content and fallback shortcodes are processed. A password-protected post displays its password form instead of the fallback.
Navigation back to the listing
The shared post navigation can include a central icon linking to a listing page. Under Settings → POM Theme → Templates, open the post type's single settings, find Posts navigation, and set Posts navigation icon link. Use the published listing page's URL directly rather than an older archive URL that redirects there.
With Polylang active, a destination that resolves to a WordPress page or post follows that item's publicly viewable translation in the current language. For example, one configured Projects page can lead to its English or Spanish counterpart. Other query parameters and fragments are preserved; object and language parameters come from the translated permalink. External URLs, unresolved destinations and items without a publicly viewable translation keep the configured URL.
After saving, open a single item in each language and follow the central icon. Confirm that it reaches the intended listing directly and stays in that language. Previous and next item links continue to use the existing navigation settings.
Featured image
Return complete image HTML:
{{featured_image image_size="large"}}
Return only its URL:
<div class="hero" style="background-image:url('{{featured_image_url image_size="full"}}')"></div>
image_size accepts a registered WordPress image size. These tags are empty when no featured image can be resolved.
Custom-field image
{{image_from_meta name="speaker_portrait"}}
name is the custom-field key containing the image value. The tag returns image HTML when the value can be resolved.
Known attachment dimensions are included automatically as numeric width and height attributes, including dimensions recovered from local SVG files. Set either dimension to a positive integer in pixels to control the image size; omit the other or use auto to preserve its proportions:
{{image_from_meta name="speaker_portrait" width="160" height="auto"}}
{{image_from_meta name="square_icon" width="40" height="40"}}
With both dimensions omitted or set to auto, the source dimensions are used. An SVG with only a viewBox needs at least one numeric dimension to produce a complete numeric pair. Unresolvable dimensions are omitted, and invalid values or CSS units such as 40px are ignored. The generated HTML never contains width="auto" or height="auto". CSS can override the display dimensions; use height: auto when changing an image's width proportionally.
Feed and single templates share the same custom-field image dimension rules and SVG requirements.
Gallery
{{gallery
meta_name="event_gallery"
style="masonry"
image_size="large"
lightbox_click="yes"
}}
| Attribute | Purpose |
|---|---|
meta_name |
Required gallery field key |
style |
Gallery presentation, including grid, masonry, carrousel, carousel_2, full_screen or images_only |
image_size |
Registered WordPress image size |
lightbox_click |
Use yes to open images in the supported lightbox presentation |
images_only returns a simple series of images without the gallery presentation wrapper.
Custom metadata
{{meta name="venue"}}
{{meta name="start_date" type="date" only_content="true"}}
{{meta name="doors_open" type="time" prepend=%%Doors: %% icon="feather/clock"}}
| Attribute | Purpose |
|---|---|
name |
Required custom-field key |
type |
Format the value as date, datetime or time |
only_content |
Use true to omit the default metadata wrapper |
prepend |
Text before the value |
append |
Text after the value |
icon |
Icon shown with the wrapped form |
translatable |
Marks supported labels for translation |
When only_content="true" is omitted, POM adds a metadata wrapper with classes based on the field key.
Icons and translated strings
{{icon family="feather" name="map-pin"}}
{{translatable_string text=%%Location%%}}
Use %%...%% for translated labels containing spaces or punctuation. See Format merge-tag attributes for nested labels.
Complete example
<article class="profile">
<header class="profile-header">
{{featured_image image_size="medium_large"}}
<div>
<h1>{{title}}</h1>
{{if meta="role" value="not_empty"}}
<p>{{meta name="role" only_content="true"}}</p>
{{/if}}
</div>
</header>
<div class="profile-content">{{content}}</div>
{{if meta="photo_gallery" value="not_empty"}}
{{gallery meta_name="photo_gallery" style="grid" image_size="medium" lightbox_click="yes"}}
{{/if}}
{{posts_nav}}
</article>