pom_theme_assign_template: assign a template
Points a part of the site at a custom template. This is the call that makes a template render.
Arguments
| Argument | Required | Meaning |
|---|---|---|
target_type |
Yes | What to change; see below |
template_id |
Yes | The template's identifier |
post_type |
For CPT targets | Which custom post type |
archive_results_layout |
No | The result wrapper, for feed targets |
dry_run |
No | Validate without writing |
Permissions
Allow POM Theme writes open, plus manage_options.
The six targets
target_type |
Assigns a | To |
|---|---|---|
post_archive |
archive template | the blog archive |
post_archive_feed |
feed template | blog archive results |
post_single |
single template | single posts |
cpt_archive |
archive template | a custom post type's archive |
cpt_archive_feed |
feed template | that archive's results |
cpt_single |
single template | that post type's singles |
Anything else returns pom_ai_mcp_unknown_assignment_target.
The three cpt_ targets require post_type, and the post type must be registered — otherwise pom_ai_mcp_unknown_post_type.
The template type must match the target
An archive target takes an archive template, a single target a single template, a feed target a feed template. The tool derives the expected type from the target and refuses a mismatch with pom_ai_mcp_template_not_found.
That error therefore has two causes: the identifier does not exist at all, or it exists as a different type. Check both.
archive_results_layout applies only to feed targets
It sets the wrapper the result items render inside. Accepted values:
default, default_masonry, only_image, horizontal_list, horizontal_list_thumbnail, horizontal_list_big, horizontal_list_creative, no_wrapper.
Anything else returns pom_ai_mcp_invalid_archive_results_layout. Omitting it leaves the current wrapper alone.
The wrapper and the feed template are different things: the template is the card, the wrapper is the grid or list it sits in. A card designed for a grid can look wrong in horizontal_list, so change them together and check the result.
It overwrites without telling you what was there
The response is updated: true and nothing else. The previous assignment is not reported.
Read pom_theme_get_template_assignments first and keep the value — it is what you would need to undo the change.
Read the assignments, then assign the new template to the blog archive only.
cpt_single can report success without changing anything
The single-post-type layout is stored on the post type's own definition, and the tool updates the row whose slug matches. If no row matches — the post type exists in WordPress but is not one of POM Theme's own custom post types — nothing is changed and the response is still updated: true.
So a cpt_single assignment that appears to succeed and has no effect usually means the post type is registered by a plugin rather than by POM Theme.
Confirm by reading the assignments back and checking the post type's single_layout actually holds your identifier. This is the one target where verification is not optional.
The dry run validates properly
It runs the target check, the post type check, the template existence and type check, and the wrapper value check — then returns what it would assign, without writing.
So a dry run is a genuine test that the assignment is possible:
Dry-run assigning that template to the products archive.
If the dry run passes, the real call will assign. What it cannot tell you is what the page will look like.
The change is immediate and public
There is no draft. As soon as the write lands, and caches clear, visitors see the new template.
For a live archive, prefer building and reviewing the template first, then assigning during a quiet period.
After assigning
- Read the assignments back and confirm the identifier is stored — especially for
cpt_single. - Load the affected archive or post.
- For feed assignments, check several result items, not one.
- Purge the cache.
Common problems
| Symptom | Cause |
|---|---|
| The write is refused | POM Theme write gate closed |
pom_ai_mcp_forbidden |
Missing manage_options |
pom_ai_mcp_unknown_assignment_target |
Not one of the six targets |
pom_ai_mcp_unknown_post_type |
Missing or unregistered post_type |
pom_ai_mcp_template_not_found |
Wrong identifier, or wrong template type for this target |
pom_ai_mcp_invalid_archive_results_layout |
Unsupported wrapper value |
updated: true but nothing changed |
A cpt_single target whose post type is not POM Theme's |
| The cards look wrong in the grid | Template and wrapper layout disagree |
| The old template still renders | Cache or CDN |
Related
pom_theme_get_template_assignments— read firstpom_theme_upsert_html_template— build it firstpom_theme_configure_content_model— do both at once