A template is markup that many pages share. Delta has nine base template types. Integrations add types while their plugins are active.
The base types
| Type | Renders |
|---|---|
| Single | One entry: a post, a page, a product |
| Archive | A listing: the blog, a category, an author |
| Search Results | The search page |
| 404 | The not-found page |
| Loop item | One row inside a listing |
| Comments | The comment list and comment form on an entry |
| Header | The chrome above every page |
| Footer | The chrome below it |
| Regular | A reusable piece, on no page by itself |
Single, Archive, Header and Footer go live through display conditions. Search Results and 404 need no conditions: the type selects the page. Loop items and comments templates appear where another template names them by slug. A regular template appears only where you include it. WooCommerce adds its own types when the plugin is active.
Header and footer placeholders use the page being shown, including its title and URL. Inside script and template tags, only site placeholders are resolved. See Placeholders.
MemberPress adds login, account, signup, pricing, thank-you and paywall templates. Its cart, shop and checkout templates apply only while the MemberPress cart is on. Checkout must render through {{content}}. LifterLMS uses Delta’s existing template types; an archive template replaces its catalogue. A Tutor LMS course page or its course catalogue renders through a Delta design or template when one exists, and a lesson design is the body of the Tutor learning player. See MemberPress, LifterLMS and Tutor LMS.
A new site has no templates
Delta ships no templates. Until you build them, Delta shows a plain layout on every page:
- The header is the site name, linked to the home page.
- The footer is the copyright year and the site name.
- A post or page shows its title and content, plus comments when they are open.
- The blog, archives and search show a heading and a linked list of post titles, with pagination.
The agent can build the basic set for you: header, footer, single, archive, search, 404, a loop item and comments, plus shop templates when WooCommerce is active. It checks what exists first and does not replace a template without your clear yes.
“Build the basic site templates.”
Any page type you do not build keeps the plain layout until you do.
Includes
Build a piece once and reuse it. Put {{include:slug}} where you want it:
“Make the call-to-action band a reusable template and include it on the three service pages.”
Edit the template once and all three pages change. The included template brings its own CSS and JavaScript.
Only published regular templates can be included. Includes nest five levels deep. A cycle, or a slug that does not exist, leaves the placeholder on the page rather than looping or failing silently.
Include or copy
Link inserts an include, so the page follows the template. Replace, append and prepend paste a copy the page owns. Ask the agent to detach an include into a copy, or relink a copy back.
Deleting
Delta refuses to delete a template that other documents include, and names them.
When you save a template, Delta names any template it ties with and any template that shows nowhere. See Display conditions.
Sites upgraded from a version before 0.2.0 can still have designated default templates. You can delete them, set them to draft, or change their type like any other template. Theme updates never overwrite your templates.
For developers
Type slugs: single, archive, search, error, loop_item, comments, header, footer, regular. Legacy section, page, partial coerce to regular. Registry filter: 21press_delta_template_type_registry. MemberPress types are mp_login, mp_account, mp_signup, mp_pricing, mp_thankyou, mp_paywall, mp_cart, mp_shop and mp_checkout. The last three require the MemberPress cart. See Developer hooks for the hook reference.
{{include:ref}} takes a slug or numeric ID, resolves published includeable types only, and caps at depth 5. Depth, cycle, or miss returns the placeholder unexpanded; nested CSS and JS collection uses the same guards.
Deleting an included template returns 21press_delta_template_in_use with a reference count, bypassable with force: true.