daypress
admin route/d-admin/theme-layouts
doc versionv1.0.4
reading time5 min read
section group14 · DayStudio & Appearance
Docs/DayStudio & Appearance
/d-admin/theme-layouts5 min readv1.0.4

Conditional Theme Templates (Single, Archive, 404) & SSR Tokens

Appearance → Theme Layouts (/d-admin/theme-layouts) brings full Elementor Pro / Block Theme template routing to Daypress—separating structured content in SQLite from reusable presentation layouts.

Template slots & include/exclude display conditions

Each template in /d-admin/theme-layouts combines a template_type, an integer priority (higher wins when multiple templates match), and include / exclude condition rules:

template_typeTarget RoutesExample Display Conditions
single_postBlog posts & Custom Post Type singlesInclude post_type:case_study (priority 20); fallback all_posts (priority 10).
single_pageStandard static pagesInclude all_pages, Exclude front_page or specific post IDs.
archiveBlog index, CPT archives, categories, tags, authorsInclude archive:portfolio or taxonomy:category.
error_404Unmatched 404 Not Found routesInclude entire_site (with embedded SearchForm recovery).
http://localhost:8090/d-admin/theme-layouts — Conditional Dynamic Templates
Daypress Theme Layouts dashboard showing Single Post, Single Page, Archive, and 404 templates with active condition badges
Appearance -> Theme Layouts (/d-admin/theme-layouts) routes Single, Archive, and 404 templates by condition and priority.

Dynamic SSR token reference

Place any token below inside a Heading, Text, Button URL, or Image source inside your template; SsrInjector hydrates it per request on the server:

TokenResolved SSR Output
{{post.title}} / {{post.excerpt}}Escaped post title or summary excerpt.
{{post.content}}Full rendered post body HTML (inject inside your article column container).
{{post.date}} / {{post.modified}}Formatted publication or last-modified date (uses date_format option).
{{post.featured_image}}Resolved /uploads/... URL of the post's featured media attachment.
{{author.name}} / {{author.bio}}Display name and biographical info of the post author.
{{acf.<field_name>}}Value of any Structured Field (e.g., {{acf.client_name}} or {{acf.headline_metric}}).
{{site.title}} / {{site.url}}Global site name (blogname) and canonical base URL.
Full-Canvas Override Rule: When an individual post or CPT item has its own top-level DayStudio Section layout saved in layout_json, Daypress renders that page's bespoke canvas directly instead of wrapping it inside a single_post prose template.

Saving a conditional CPT template via MCP

json (mcp)
// MCP: daypress_save_template
{
  "name": "Case Study Single Layout",
  "template_type": "single_post",
  "status": "publish",
  "priority": 20,
  "conditions": [
    {"rule_type": "include", "target": "post_type:case_study"}
  ],
  "layout_json": "{...DaypressLayout AST using {{post.title}}, {{acf.headline_metric}}, {{post.content}}...}"
}