Skip to content

EMCP Themer

New in v3.1.0. EMCP Themer is a builder-agnostic WordPress theme builder: design Header / Footer / Single / Archive / Search / 404 layouts with any page builder (Gutenberg, Elementor, …), assign display conditions, and the plugin injects them on the front end. It’s free and on by default, with 9 MCP tools so an AI agent can create and target templates end to end.

Loops (Loop Item / Loop Grid) are intentionally out of scope.

  • One CPT, any builder. Templates are a single custom post type (emcp_theme_template), editable by whatever builder you use: Gutenberg, Elementor, or another. Each template is typed (header/footer/single/archive/search/404) and carries its display conditions.
  • Its own dashboard menu. Themer gets a top-level EMCP Themer menu in wp-admin (not a tab inside EMCP Tools). The menu only exists while the module is active. Disabling the module is a true kill switch for the CPT, front-end rendering, tools, and menu.
  • Slot-based resolution. Every request fills up to three slots: header / body / footer. The body slot’s type is derived from the main query (singular → single, archive → archive, plus search and 404). A pure resolver picks one winner per slot by matched-condition specificitypriority → newest.
  • Conditions are Include / Exclude rules evaluated against a rebuilt-on-save, autoloaded condition index, so there are zero extra front-end database queries.
  • Hybrid render engine. A body template (single/archive/page/search/404) keeps your theme’s header and footer and swaps only the content area, exactly like Elementor Pro’s Single templates. If you also build both a Themer header and footer, Themer renders a complete standalone document instead (no theme chrome). A single standalone header or footer is injected at the active theme’s hook via per-theme adapters, Astra, GeneratePress, Kadence, OceanWP, Blocksy, Neve, Hello, with a template-tag (emcp_themer_location('header'|'footer')) and an optional force-render fallback for unsupported themes.

Honest limitation: dynamic single/archive templates are most powerful with Elementor’s dynamic tags; Gutenberg shines for header/footer/404/search.

The template edit screen has an Elementor-style step-wise condition builder: Relation → Group → Sub-type → Object, plus an “Add condition” repeater. It’s type-aware: a Single template offers Singular targets, an Archive template offers Archives, Header/Footer can target anything, and Search/404 need no conditions.

FreePro
Render engine + all template types
Templates per type1Unlimited
Scope selectorsEntire site · all singular · front page · one post type · all archives · one post-type archive · one taxonomy archive+ per-post, per-term, author, author-archive, date
RulesIncludeInclude and Exclude
Priority ordering
All 9 MCP tools

The whole engine and all 9 tools are free; Pro adds unlimited templates per type, granular targeting, Exclude rules, priority, and the dynamic sources that need configuring.

Classic themes don’t ship the dynamic parts you need to build a template, so Themer adds its own: 19 Elementor widgets and 14 Gutenberg blocks, under an EMCP Themer category in each builder. They resolve against the current request, so a Single template’s Post Title shows the viewed post and an Archive template’s Archive Posts shows that archive’s posts.

Nine of these arrived in v3.13.0, which is what makes a Single, Archive, Search or 404 template finishable without Elementor Pro.

ElementWhat it outputsElementorGutenberg
Post/Page TitleThe queried post’s title (tag + optional link)
Post ContentThe queried post’s full content
Post ExcerptThe excerpt, optionally trimmed to a word count
Featured ImageThe featured image at any registered size, optionally linked
Post MetaDate, author, categories, tags, comments (pick which)
Post InfoAn ordered metadata row: author, date, time, comment count, terms, or a custom field, in the order you list them
Author BoxAvatar, name, biography and links, each part switchable
Post NavigationPrevious / next links, optionally staying within the same term
Post CommentsThe comment list and form
Archive TitleThe archive’s title (category / tag / author / date / post type)
Archive PostsThe archive loop: grid or list, columns, image, excerpt, read-more, pagination
Archive Posts (classic)The original loop element, kept as-is so existing templates render unchanged
Search FormA search form, which is what makes a 404 template worth having
SitemapLists whichever post types and taxonomies you choose
BreadcrumbsA trail: uses Yoast / Rank Math / SEOPress if present, else built-in
MenuAny WordPress nav menu
Site LogoThe custom logo (linked), with a text fallback
Site TitleThe site name (linked) + optional tagline
DescriptionPost excerpt on singular, archive description on archives

Comments, search and post navigation are not duplicated as blocks, because WordPress core already ships a block for each.

Post Meta and Archive Loop are untouched. Post Info and Archive Posts are new elements beside them, not replacements, so templates you have already built keep rendering exactly as they do now.

Gutenberg blocks use native block supports (color, typography, spacing, border) so the editor’s own controls style them, with a live server-side preview. Elementor widgets add a Style tab. Because they’re regular blocks, the Gutenberg block tools (add-block, insert-pattern) can drop them into templates over MCP.

While you’re editing a theme template the EMCP Themer category is promoted to the top of the Elementor panel, directly under Favorites. On an ordinary page it stays where it was, and the widgets remain available there: a sitemap, search form or posts grid is useful outside a template too.

Elementor panel while editing a theme template, with the EMCP Themer category promoted to the top and its widgets listed

New in v3.13.0. Instead of hunting for a special widget, you pick the source from the field itself. In Elementor it appears in the dynamic picker on any field that accepts one; in the block editor it binds to a Heading, Paragraph, Image or Button. A heading can show the post title, an image the featured image, a button can link to the post.

This works on free Elementor. Elementor ships the machinery for dynamic fields but none of the sources, so on a free install that picker is empty. EMCP fills it.

Elementor's dynamic-tag picker (or the Gutenberg block-bindings UI) showing the EMCP-provided sources on a field

SourceTypeTier
Post/Page TitletextFree
Post ExcerpttextFree
Post URLurlFree
Post DatedateFree
Post IDtextFree
Featured ImageimageFree
Archive TitletextFree
Site TitletextFree
Site LogoimageFree
Description (site tagline / archive description)textFree
Custom Field (ACF-aware)textPro
Author NametextPro
Author BiotextPro
Author URLurlPro
Author AvatarimagePro
Term NametextPro
Term URLurlPro

Pro also adds a fallback value for when a field is empty, plus date and text formatting.

Sources are typed. On Gutenberg, the type is enforced when the binding is made: an image source cannot be bound to a Heading block, and a mismatched binding is refused at call time (dynamic_type_mismatch) rather than rendering blank later. On Elementor, type-matching only filters what appears in the dynamic-tag picker’s UI, it is not re-checked when a binding is set programmatically through the MCP tools, so pass sources deliberately: list-dynamic-sourcestype field is your source of truth for what a given control can actually use.

While you edit a template there is no queried post, so dynamic fields resolve against a sample post for preview purposes. The sample is chosen at render time and is never written into the template.

All 9 register when the Themer module is active. Build a template’s content with the Gutenberg or Elementor tools against the returned template_id.

Create a theme template of a given type.

Input: type (header/footer/single/archive/search/404), title, optional conditions.

Returns: { template_id, edit_url, type }.

List theme templates, optionally filtered by type.

Returns: array of { template_id, title, type, conditions }. Read-only.

Full detail for one template: type, conditions, detected builder, built content status.

Input: template_id. Read-only.

Update a template’s title, type, or conditions.

Input: template_id plus any of the fields.

Set a template’s display conditions (Include/Exclude selectors, priority). Granular selectors, Exclude rules, and priority require Pro. They’re rejected on free with a clear message.

Input: template_id, conditions.

Delete a theme template.

Input: template_id. Destructive.

Verify which templates fill each slot (header/body/footer) for a given post or request context: the resolver’s decision, exposed for debugging your conditions.

Input: post_id or a context descriptor. Read-only.

Discovery: list the selectors and objects (post types, taxonomies, …) you can target, so an agent can build valid conditions.

Returns: the available condition targets. Read-only.

New in v3.13.0. Discovery: what dynamic sources this site offers, what each one produces, and where it can be used, so an agent can bind fields without guessing.

Input: optional bindable_only.

Returns: { sources: [{ key, label, type, args, bindable, surfaces }], count }. surfaces reports only what actually exists for that source (widget, block, elementor-tag, block-binding), so an agent is never sent looking for a block that was never registered. Read-only.

Two existing tool families accept a binding alongside the usual settings, each with its own param shape:

  • Catalog widgets (add-free-widget / add-pro-widget, see Widgets): dynamic: { <field_name>: { source, args? } }source is a list-dynamic-sources key. update-widget does not yet accept dynamic.
  • Gutenberg blocks (add-block / update-block, see Gutenberg blocks): bindings: { <attribute_name>: { source, args? } }.

Atomic widgets (add-atomic-widget and the rest of the Atomic elements family) don’t accept a binding param at all yet, there’s no dynamic-data path for Elementor 4.0’s atomic controls today, only the legacy catalog widgets above.

For layouts that neither Gutenberg nor Elementor free can express (a bespoke query loop, custom markup, or integration with another plugin’s template tags), Themer can hand a region’s render off to a custom PHP template. A connected AI agent authors the PHP into a validated sandbox; you then select it on a template, and it takes over that region’s render. The Themer template still owns where it applies (its type + display conditions); the PHP owns what markup is produced.

The feature is free but off by default. Turn it on under EMCP Tools → Tools → “Themer PHP Templates (advanced)”. Enabling it reveals a PHP Templates screen under the EMCP Themer menu (review the code + validation report of anything an agent authored) and a “Render with PHP template” selector on each template’s edit screen.

  • You are the execution gate. An AI can only create drafts. There is no “attach” tool. A draft has no executable file on disk and never runs. It only compiles and executes once you select it on a template in the metabox. Detaching it removes the compiled file again.
  • Strict validation. Every template is scanned before it can be stored or compiled. Code execution (eval/exec/backticks), file loading (include/require), network calls, and file writes are rejected outright, the same guardrail as the PHP Snippets sandbox. Emit markup with echo/heredoc; a closing ?> tag is not allowed.
  • Tamper-proof + self-healing. Compiled templates are hash-verified on every render and run inside output buffering with fatal recovery, so a broken template falls back to your builder content instead of white-screening the page.
  • Capability-gated. Authoring requires manage_options + unfiltered_html.

A PHP template is region-only. It outputs just its region’s markup and slots into the same engine as builder content. A single/archive template renders inside your theme’s header/footer; a header/footer template replaces the theme’s chrome via the theme adapter. If the PHP produces nothing (or errors), Themer transparently falls back to the template’s builder content.

All five require the feature to be enabled and ship disabled-by-default (opt in per-tool on the Tools tab). There is intentionally no attach tool. Selection stays in your hands.

ToolPurpose
emcp-tools/create-theme-php-templateAuthor a validated draft PHP template (type: header/footer/single/archive/any). Never runs until you attach it.
emcp-tools/list-theme-php-templatesList drafts (id, title, type, compiled state, last error). Read-only.
emcp-tools/get-theme-php-templateReturn one template’s code + validation report. Read-only.
emcp-tools/update-theme-php-templateUpdate a template’s code/title/type; re-validates (and recompiles if attached).
emcp-tools/delete-theme-php-templateDelete a template and its sandbox file. Destructive.