Skip to content

Site Editor ​

In the Site Editor you design templates, template parts and patterns — a single-post layout, an archive header, a site-wide header. Dynamic tags, data loops and visibility rules all work there. There's no VX fields panel, because a template isn't one post; it's the design every post of that type uses.

Choose a sample ​

Tags need something to show while you design, so each template previews a sample entry.

When a template's name says what it's for (Auto detected based on slug), VX picks the sample and the tags show values as soon as the template opens. single-book previews your latest Book, page your latest page, taxonomy-genre the Genre with the most entries (category and tag work the same way), and author a user. front-page previews the page set as your homepage in Settings → Reading. When your homepage shows your latest posts, front-page starts as Global, like home. A custom template your theme declares for pages, such as about, previews a page that uses it, or your latest page if none does yet. Templates that show no one entry — archive-book, index, home, search and 404 — start as Global, and so do template parts and synced patterns.

When the name doesn't say which type (single, singular, taxonomy, or a custom template your theme declares for more than one post type), Dynamic data in Site Editor asks what the template is for the first time you open Dynamic tags on it:

  • Posts: pick a Post type and a Preview post.
  • Terms: pick a Taxonomy and a Preview term.
  • Users: pick a Preview user, for author templates.
  • Global: for parts shown everywhere, like a header. Site-wide tags and the current user.

To preview a different entry, or to say a template is for something else, use the gear icon under Dynamic tags context. What you pick is remembered for each template, and the preview uses it even where VX suggested Global, such as a template you made in the Site Editor and assign to pages. A sample VX picked isn't remembered, so it follows your newest content. Reset to Auto goes back to VX's pick.

The sample only affects the editor preview. On the site, each page shows its own values. You can't edit the sample's values from the template; change them on the entry itself, then refresh the preview.

Query Loops in templates ​

Inside a WordPress Query Loop, only the cards — the blocks in the post template — read the post each card is showing. The header beside the loop, and pagination, stay the template's own subject: on an archive that is Global, so @post there has nothing to bind to.

A loop that follows the page query lists that page's posts (Books on archive-book). A loop with its own post type lists that type, wherever it sits.

To show items stored on each post inside a Query Loop card, such as that post's photos, add a data loop inside the card.

Technical details for LLMs
  • The Site Editor integration loads for users with edit_theme_options (or edit_posts); there's no fieldset panel on templates, template parts or patterns.
  • Preview choices are stored for the site, one per template, and shared by everyone who edits it; the preview entity feeds vx-framework/v1/dynamic-data/preview-context / preview-entity.
  • VX's own sample comes from preview-entity (latest published post of the type, the term with the most entries, the first user) and is held for the editor session only. preview-context stores a sample only when someone picks one, including in the first-time dialog closed without Continue.
  • Custom templates are read from theme.json customTemplates. A slug the template hierarchy finds no entity in, declared for one post type, resolves to that post type (the abilities report { entity_type: post_type, post_type }); the hierarchy's own names (index, home, search, 404, archive, front-page) keep theirs even when declared. VX's sample for one is the latest post whose _wp_page_template is that slug (preview-entity takes template), then the latest of the type; preview-block-document picks the same way.
  • front-page resolves to the page in page_on_front when show_on_front is page. The block-document abilities report its context as { entity_type: post_type, post_type: page, post_id }, preview it against that page, and don't flag post blocks in it as no_entity_in_scope. When show_on_front is posts, it has no entity, like home.
  • Slug detection reads the longest name it recognizes, so single-book-the-glass-library still suggests Book. archive-{type} is Global chrome plus that type as the page query for cards. A slug that names a post type or taxonomy with no fields starts as Global, rather than suggesting a different type.
  • Inline editing of bound fields is disabled while editing a template. A page opened in the Site Editor with its template shown works like the post editor: template blocks bound to that page's own plain fields can be typed into (see Editing a bound value in place).
  • Template-level page building by an assistant goes through block documents: see Pages and templates.

Documentation for the VX Framework.