Feed templates

A feed template is rendered once per result. It owns the visible item markup; the separate result wrapper controls how all items are arranged.

Conditions

Use a custom field to include or replace optional markup:

{{if meta="subtitle" value="not_empty"}}
    <p>{{meta name="subtitle" only_content="true"}}</p>
{{else}}
    <p>{{translatable_string text=%%No subtitle%%}}</p>
{{/if}}

The condition matches an exact saved value, empty or not_empty.

Post fields

Merge tag Important attributes Result
{{post_id}} None Current item ID
{{title}} None Item title; product results also apply the WooCommerce loop title-area output
{{permalink}} None Item URL
{{post_content}} fallback_message Main content or fallback
{{excerpt}} limit Plain excerpt with an optional character limit
{{date}} format, prepend, append Published date
{{date_updated}} None Modified date
{{comments}} None Comment count linked to the comments section
{{author}} None Author display name
{{author_url}} None Author archive URL

Example:

<article>
    <a href="{{permalink}}"><h2>{{title}}</h2></a>
    {{date format="j F Y" prepend=%%Published: %%}}
    <p>{{excerpt limit="160"}}</p>
</article>

Featured media

Featured image

{{featured_image image_size="medium_large"}}

For a product without an image, WooCommerce's placeholder is used. Add hide_default="true" to suppress it.

Return only the URL with an optional fallback:

{{featured_image_url
    image_size="medium_large"
    fallback_url="/wp-content/uploads/card-placeholder.jpg"
}}

Product video

{{featured_video}} renders the configured featured product video and falls back to the product image. {{video_thumbnail image_size="large"}} renders the first configured product video, or the product image when no video is available.

Custom fields

General value

{{meta name="venue"}}
{{meta name="start_date" type="date" only_content="true"}}
{{meta name="summary" limit="120" prepend=%%Summary: %% append=%%…%% icon="feather/info"}}

name is required. type accepts date, datetime or time. only_content="true" omits the default metadata wrapper. prepend, append, limit and icon adjust the visible output.

Image

{{image_from_meta name="card_image"}}

The tag returns image HTML when the field value can be resolved as an attachment.

The image includes numeric width and height attributes when its dimensions are known, so the browser can reserve space before it loads. You can set a display dimension in pixels and let the other follow the image's proportions:

{{image_from_meta name="icon" width="40" height="auto"}}
{{image_from_meta name="portrait" height="80"}}
{{image_from_meta name="square_icon" width="40" height="40"}}
Attribute Accepted values and behavior
width A positive integer in pixels, or auto
height A positive integer in pixels, or auto

Omitting both dimensions, or using auto for both, uses the attachment's dimensions. With one numeric dimension, the other is calculated from the source aspect ratio and rounded to the nearest positive integer. Set both numbers only when they match the intended image proportions. Invalid values, zero, negative values, and CSS units such as 40px are ignored. auto is resolved before HTML is generated; it is not emitted as an HTML dimension attribute.

For SVG attachments up to 512 KiB, the tag uses absolute dimensions declared in a readable local Media Library file and its viewBox to calculate a missing dimension. Absolute units such as px, pt, and cm are converted to pixels. An SVG with only a viewBox supplies proportions but no intrinsic pixel dimensions: provide at least one numeric dimension in the tag. For larger files or when local geometry cannot be read, available attachment metadata is used. If the dimensions or proportions remain unknown, unresolved attributes are omitted; provide both numeric dimensions to reserve a known space.

These attributes reserve space and establish proportions; CSS can still control the displayed size. For responsive images, preserve the aspect ratio with max-width: 100%; height: auto;. After changing a template, verify the image in the frontend at desktop and mobile widths.

Gallery

{{gallery
    meta_name="photos"
    style="masonry"
    image_size="medium"
    lightbox_click="yes"
}}

meta_name is required. Supported presentations include grid, masonry, carrousel, carousel_2, full_screen and images_only.

Video URL

{{video_from_url
    meta_name="video_url"
    play_button="true"
    controls="true"
    loop="false"
    autoplay="false"
}}

The field must contain a YouTube or Vimeo URL. The four behavior attributes use true to enable their option.

Button URL

{{button_from_meta
    meta_name="booking_url"
    label=%%Book now%%
    style="5"
    rel="nofollow"
    icon="arrow-right"
    size="default"
    block="yes"
}}

No button is rendered when meta_name is missing or its value is empty.

Nested feed

{{feed_from_meta
    meta_name="related_items"
    template_id="my-feed-template"
    layout="default"
    columns="12"
    columns_default="4"
    columns_default_tablet_h="6"
    columns_default_tablet_v="6"
    columns_default_mobile="12"
}}

The source field must contain selected post IDs in the format produced by the corresponding POM field. template_id is required. A nested feed is limited to six related posts.

Taxonomy terms

{{taxonomy_terms
    taxonomy="category"
    taxonomies_with_links="true"
    without_wrapper="true"
    number="3"
}}

Useful options include taxonomy, taxonomies_with_links, without_wrapper, number, display_color, tooltip, link_color, category_thumbnail and circle_thumbnail.

Icons, translated labels and interactions

{{icon family="feather" name="heart"}}
{{translatable_string text=%%Read more%%}}
{{add_to_favorite family="bootstrap" icon="heart"}}
{{like_button family="bootstrap" icon="hand-thumbs-up"}}

Favorite behavior depends on the corresponding theme feature being available. The like button displays the current count and control.

WooCommerce product tags

Merge tag Output or attributes
{{price}} Formatted product price
{{rating}} Product rating
{{stock}} Product stock presentation
{{display_attribute_info attribute="color"}} Values for the named global product attribute; omit the pa_ prefix
{{e_commerce_product_img_from_gallery number="1" mode="img" image_size="large"}} One product gallery image; mode="img" returns image HTML and other modes return its URL
{{e_commerce_product_time_slots}} Available booking slots when a supported booking product is listed with start-date input
{{e_commerce_product_btn style="5"}} WooCommerce loop action button
{{sale_text text=%%Sale%%}} Label only when the product is on sale
{{sale_amount type="percent"}} Calculated discount number prefixed with a minus sign; use type="amount" for a formatted currency amount

Product-only tags return no content for other post types.

The percent form does not append a percent sign. Add it after the tag when the design needs one:

{{sale_amount type="percent"}}%

Complete product-card example

<article class="product-card">
    {{sale_text text=%%Sale%%}}
    {{title}}
    {{e_commerce_product_btn}}
</article>

For products, {{title}} runs the WooCommerce loop title-area output. Depending on the active WooCommerce hooks, that output can already include the product image, title, rating and price. Add the individual product tags only when the site's loop hooks do not already provide the same element.

Limits and fallbacks

  • Unknown feed tags remain visible in braces, making a spelling or type mismatch detectable.
  • A missing or unusable custom result template produces a minimal title-only card.
  • Empty optional fields normally produce no dynamic output, but authored wrapper HTML remains.
  • Fields used through Faceted Search must be available to that result context; update the relevant index after changing indexed data.

Related guides