Intro to Templates
Templates are the foundation of your website's structure and content organization. Think of them as the architectural blueprints that determine how your content is displayed across different pages and contexts.
While a website might have 100 URLs, there's a good chance that a vast majority of those URLs are generated by templates.
Good development practices suggest that you should consider creating a template any time multiple URLs are going to render the exact same layout and content type.
Mandatory Templates
WordPress requires a few core templates to ensure your site displays content correctly. The most important mandatory template is the index template (index), which acts as the ultimate fallback for all content types. If no other, more specific template matches a request, WordPress will use the index template to render the page.
At minimum, every WordPress site must have:
- Index Template (
index): The catch-all template. If you only have one template, it should be this one.
Recommended Templates
The following templates are not required, but are highly recommended:
- Single Template (
single): For displaying individual blog posts (if the site has a blog). - Archive Template (
archive): For displaying lists of posts, such as blog archives, category pages, or custom post type listings. This template is used whenever WordPress needs to show a collection of items rather than a single post or page. - Author Template (
author): For displaying posts written by a specific author, often including the author's bio and a list of their posts (if the site has a blog). - 404 Template (
404): For handling "Page Not Found" errors.
Why Templates Matter
Templates provide several key benefits:
- Consistency: Ensure a uniform look and feel across your specific parts of your website.
- Efficiency: Create once, use everywhere - templates eliminate repetitive design & dev work.
- Maintainability: Update a template once to change the appearance of all pages using it.
- Scalability: Easily add new pages that follow your established design patterns.
- User Experience: Provide predictable navigation and content presentation.
WordPress FSE Integration
All templates created in Etch are automatically authored to WordPress' Full Site Editing (FSE) templating system. This liberates your templates the same way your page development is liberated into custom blocks.
Getting Started
In the following sections, you'll learn how to create, customize, and manage templates in Etch. You'll discover how to build templates from the ground up, how to work with dynamic content, and how to create variations for different page types.
Remember, templates are not just about visual design - they're about creating a systematic approach to content presentation that serves both your users and your content management needs.