NewMeet Native Connect WP: your AI builds in Elementor, Bricks and Breakdance.Native Connect WP is here.See how

DocsDynamic data & loops

Dynamic data

Put WordPress data — the post’s title and date, the author, custom and ACF fields, the visitor’s name, the current year — into any text, link, image or setting, with a fallback for empty values.

How it works#

Dynamic data is written as a token inside ordinary text: Written by {author_name} on {post_date:F j, Y}. When the page is shown, Native WP AI replaces each token with its value. Tokens work in any text, link, image, HTML attribute and background, and in form fields, menu labels and conditions.

  • {name} — a value, like {post_title}.
  • {name:argument} — with an argument, like a date format or a field name: {custom_field:city_name}.
  • {name|fallback} — with text to show when the value is empty: {custom_field:city_name|our city}.

You don’t have to type them: every field that accepts dynamic data has a picker next to it, grouped and searchable, that asks for the argument and the fallback and shows a live preview. The canvas shows real values from a preview post, so templates look like the real thing while you design.

A blog post template with dynamic data: the picker lists post, author, site and custom fields to insert into any text
The dynamic data picker: post, author, site and custom fields.

Every token#

101 tokens:

Post

TokenShows
{post_title}Title
{post_excerpt}Excerpt
{post_content}Content
{post_url}Permalink
{post_id}ID
{post_type}Post type
{post_date:F j, Y}Publish date
{post_modified:F j, Y}Last modified date
{post_categories}Categories
{post_tags}Tags
{post_terms:category}Terms of a taxonomy
{post_comments}Comment count
{reading_time}Reading time (minutes)
{featured_image}Featured image
{featured_image_url}Featured image URL
{featured_image_alt}Featured image alt text

Author

TokenShows
{author_name}Name
{author_bio}Bio
{author_url}Posts page URL
{author_avatar}Avatar
{author_meta:twitter}Author field

Site

TokenShows
{site_title}Site title
{site_tagline}Tagline
{site_url}Home URL
{site_logo}Logo

Logged-in user

TokenShows
{user_name}Display name
{user_first_name}First name
{user_email}Email
{user_role}Role
{user_avatar}Avatar
{user_meta:company}User field

Archive, term & search

TokenShows
{archive_title}Archive title
{archive_description}Archive description
{term_name}Current term name
{term_description}Current term description
{term_url}Current term URL
{term_meta:color}Term field
{search_query}Search query

Custom fields

TokenShows
{custom_field:city_name}Custom field
{acf:price}ACF field
{acf_image:hero_image}ACF image
{acf_url:brochure}ACF link or file URL
{acf_gallery:photos}ACF gallery

WooCommerce product

TokenShows
{product_price}Price
{product_regular_price}Regular price
{product_sale_price}Sale price
{product_sale_badge}Sale badge
{product_discount}Discount (%)
{product_sale_ends:F j, Y}Sale end date
{product_rating}Average rating
{product_review_count}Review count
{product_sku}SKU
{product_stock}Stock status
{product_stock_text}Availability
{product_stock_quantity}Stock quantity
{product_total_sales}Units sold
{product_short_description}Short description
{product_categories}Product categories
{product_tags}Product tags
{product_attribute:color}Attribute
{product_weight}Weight
{product_dimensions}Dimensions
{product_type}Product type
{product_add_to_cart_url}Add to cart URL
{product_add_to_cart_text}Add to cart text
{product_gallery}Product images

WooCommerce store & cart

TokenShows
{shop_url}Shop URL
{cart_url}Cart URL
{checkout_url}Checkout URL
{account_url}My account URL
{currency_symbol}Currency symbol
{cart_count}Items in the cart
{cart_total}Cart total
{customer_order_count}Customer’s orders
{customer_total_spent}Customer’s total spent
{customer_last_order_date:F j, Y}Customer’s last order date

Course (Courses)

TokenShows
{course_price}Price
{course_access}Access
{course_lessons}Lessons
{course_topics}Topics
{course_quizzes}Quizzes
{course_duration}Length
{course_level}Level
{course_students}Students
{course_rating}Average rating
{course_reviews}Reviews
{course_instructor}Teacher
{course_categories}Course categories
{course_url}Course URL
{course_progress}Visitor’s progress (%)
{course_status}Visitor’s status
{course_button_text}Button text
{course_button_url}Button URL
{course_certificate_url}Visitor’s certificate URL
{course_points}Visitor’s course points

Date & time

TokenShows
{current_date:F j, Y}Today’s date
{current_year}Current year

URL & query

TokenShows
{url_param:utm_campaign}URL parameter
{query_var:paged}Query variable

External & loop data

TokenShows
{api:player.name}Data field
{item:name}Loop record field

Tokens can be formatted — {item:price~currency(USD)}, {post_date~ago} — see Format dynamic values.

In loops and templates#

Inside a Query Loop, post tokens show each result’s own data. In a template, they show the post, term or author being viewed. {item:…} reads the current record of a loop over external data, and {api:@source.path} reads a data source anywhere on a page.

Custom fields and ACF#

The picker lists your field groups and their fields by label — Native WP AI’s own and, with Advanced Custom Fields (free or PRO) or Secure Custom Fields active, ACF’s — and only offers the fields that fit: images where an image goes, links and files in links, galleries in galleries. Every field type works:

Field typeIn textIn a linkAs an image
Text, text area, number, email, URL, editor, oEmbed, date, timeThe valueURL fields—
ColorThe color (#ff6600, or rgba(…) with opacity), also for styles——
Select, checkbox, radio, button groupThe choice (as ACF returns it); several are listed——
True / false“Yes” or nothing——
ImageIts addressIts addressThe image, with its alt text and sizes
Gallery——The first image; the whole list in a dynamic gallery (below)
FileIts titleThe file—
LinkIts textIts URL (and it opens in a new tab if set so)—
Post object, relationship, page linkThe post titlesThe post’s address{acf_image:field.image}: the post’s featured image
Taxonomy, userThe namesThe term or author page—
Google MapThe addressA Google Maps link—
Group, cloneTheir sub-fields by path: {acf:hero.title}
IconThe icon’s name—A Media Library or URL icon
Menu (Secure Custom Fields)The menu’s name——
Repeater, flexible content{acf:speakers~count}: how many rowsA Query Loop shows the rows
  • A dot reads inside a value: {acf:hero.title} (a group’s sub-field), {acf:tickets.url}, {acf:brochure.size}, {acf:photo.alt}, {acf:venue.city}.
  • Prefixes read other places: {acf:option:phone} an options page, {acf:term:color} the archive’s term, {acf:user:company} the logged-in visitor.
  • Password fields are never shown. Private fields (names starting with _) and fields that look like credentials are hidden too. Settings → Dynamic data → Always allow these custom fields makes exceptions; Never show these custom fields hides more.
  • Settings → Dynamic data → Advanced Custom Fields turns ACF support off.

Dynamic galleries#

An Image Gallery or Image Carousel can take its images from the post: select it, click Use dynamic images above its images, and pick an ACF gallery, a repeater’s image sub-field (each row’s photo), the featured images of a relationship field, or Product images (the WooCommerce product’s main image and gallery). Inside a loop over data, a list of images in the record works too.

Each post shows its own images, with their alt text, captions and responsive sizes; the lightbox, layout and hover effects work as usual. A post with no images shows an empty gallery on the site. The gallery’s own images only show in the builder then, so you can still design it.

Safety#

Values are escaped for where they go: plain text in text, safe URLs in links (anything unsafe becomes #), validated values in styles. In the builder, custom fields are only previewed for posts you can edit.

A screenshot, full size