Your Cart
WordPress custom templates

How to Create and Assign WordPress Custom Templates for Posts, Pages and Archives

WordPress custom templates let you shape a reusable layout for posts, pages and archive views without rebuilding the structure separately for every item. They are useful when several pieces of content should share the same arrangement of blocks, template parts and content areas. The key distinction is simple: the individual post or page provides the content, while the template defines the layout in which that content is displayed.

The documented workflow is primarily intended for block themes with Site Editor support. In this guide, you will see how the WordPress Template Editor works, how to create a template for a known content context, how to build a Custom Template for later assignment, and how to review changes before they affect shared content.

What the WordPress Template Editor Does

The WordPress Template Editor is a block-based interface for creating and editing templates. Templates can control layouts for pages, posts and other supported page types, including author, category, tag and date archives. A template can be supplied by the active theme or created and saved by the site owner.

Its purpose is broader than editing the text or media inside one page. A template can define the reusable arrangement of elements such as the title, featured image, post content, metadata, query loop and template parts. The exact blocks available and the visible controls can depend on the active theme and the editing context.

Template layout versus individual content

Editing an individual page changes that page’s content. Editing a template changes the layout used by content assigned to it. This difference matters when deciding where to make a change. If only one article needs different wording, images or paragraphs, edit the article itself. If several articles should follow one shared structure, a template may be the more appropriate place to define that structure.

Shared changes require care. When a template is changed, the blocks in that template are updated on all pages or posts that use it. A modification that looks local while working in the editor can therefore affect multiple URLs. Review the intended scope before saving and test the result after making substantial changes.

Before You Start: Block Themes and Site Editor Access

The workflow described here depends mainly on a block theme that supports the Site Editor. In the WordPress dashboard, the Site Editor is accessed through Appearance > Editor. From there, users can access templates and template parts and manage layouts with blocks.

Block themes use block-based HTML templates and allow the block editor to work with broader site areas, including template-driven layouts. Classic themes use a different theme model and may expose different template controls. The same Template Editor workflow should not be assumed to appear in the same way for every classic theme.

Confirm the active theme supports the workflow

Start by checking whether Appearance > Editor is available in your dashboard. If the expected Editor or Templates controls are missing, the active theme may not provide the block-theme workflow described in this article. This does not establish that a particular third-party theme is compatible or incompatible; it simply means that its available controls need to be confirmed in its own environment.

Interface labels and screen layouts can vary between WordPress versions and themes. Treat the documented names as a practical guide, then confirm the wording and options displayed in your installation before following each step.

How to Create a Custom WordPress Template

In a block theme, open Appearance > Editor, go to Templates and select Add Template. WordPress presents template contexts that can include Pages, Single item: Post, archive types and the separate Custom Template option. Choose the scope before designing the layout, because the choice determines how the template is used.

Select the template scope before building

Choose Pages when the template is intended for a page-oriented context. Choose Single item: Post when the layout is intended for individual posts in that context. When the design should serve a grouped archive, select the relevant archive type, such as a category, tag, author or date archive.

Choose Custom Template when you want to create a reusable layout that can later be assigned to a selected post, page or custom post type. This is an important distinction: a Custom Template is not assigned to a particular item automatically. The assignment happens separately from the post or page editor.

Use a descriptive name that makes the intended purpose clear. A recognizable name helps you select the correct template later, especially when several layouts exist.

Build and save the layout

After choosing the scope, construct the layout with blocks or begin from an available pattern. Arrange the required content areas and template parts within the block-based editor. The template supplies the reusable structure; the content item supplies its own title, text, media and other content.

Review the layout while editing, then save or publish the template when it is ready. Saving a defined page, post or archive template establishes its layout for the corresponding context. Saving a Custom Template makes it available for assignment, but does not by itself apply it to a selected post or page.

Keep the scope in mind while building. A layout intended for an archive should be evaluated as a grouped listing structure, while a single-post layout should be reviewed as the presentation of one item. Do not infer SEO, accessibility, performance or conversion results merely from using a template.

How to Assign a Custom Template to a Page or Post

Once a Custom Template exists, open the selected post or page in the block editor. Use the Post/Page Settings sidebar to locate the current template control. Select the displayed template name and use the template selection or Change template option, depending on the editor view.

Choose the intended Custom Template, then save or update the content. Because a Custom Template is not assigned automatically, this step is required before the selected item uses that layout. The exact label may vary with the WordPress version and editing context, so focus on locating the function rather than expecting identical wording in every dashboard.

Assign from the post or page editor

Use this sequence as a practical checklist:

  1. Open the target post or page in the block editor.
  2. Open the Post/Page Settings sidebar.
  3. Select the current template name or the available change option.
  4. Choose the intended Custom Template.
  5. Save or update the content, then review the result.

After assignment, preview the item and check the front-end result. The template changes the reusable layout, so confirm that the expected content blocks and template parts appear in the intended positions. If the result is not correct, check whether the selected item is using the template you expected before changing the template itself.

Choosing Between Single-Post, Page and Archive Templates

Template scope should follow the content group that needs a common layout. A page-oriented template serves a page context, a single-post template serves an individual post context, and an archive template serves a grouped view. A Custom Template is useful when selected items need a reusable layout but should not automatically receive a broader context-based template.

Single-post and page use cases

Use a single-post template when selected posts, or a defined post context, need a different structure from the regular single-post layout. For example, a site may need a separate arrangement for a feature article or a long-form editorial format. These are scope-based use cases, not guarantees of a particular design or business result.

Use a page-oriented template when pages need a shared structure. If only one page needs a local content change, editing that page’s content may be more appropriate than creating or changing a shared template. The decision should be based on whether the difference belongs to the reusable layout or to one content item.

Archive scope and fallback behavior

Archive templates can target categories, tags, authors and dates. They are appropriate when a group of archive pages should follow a consistent listing structure. A more specific archive context can be handled by its corresponding template rather than by one general layout.

All Archives can act as a fallback when a more specific archive template, such as a category or tag template, is not available. This makes it useful for a broader archive structure, while specific archive templates allow the layout to be targeted more narrowly.

Template Hierarchy, Testing and Maintenance

WordPress selects templates according to the requested content or URL context. In block themes, user-created templates saved in the database can take priority over templates supplied by a child theme or the active theme. This precedence helps explain why a customized layout may continue to appear even when the theme includes its own template.

Why WordPress may show an unexpected template

When the displayed layout is unexpected, first consider the content context: is the URL a single post, a page, a category archive, another archive type or a broader archive view? Then check whether a user-created template exists for that context. A saved user template may have priority over the bundled theme template.

For archives, compare specific templates with the broader All Archives fallback. A category, tag, author or date template may determine the result when it exists, while the general archive template can be used when a more specific option is unavailable. Also check whether the selected post or page was explicitly assigned a Custom Template.

A pre-publication review checklist

Before publishing a shared template change, review its scope rather than assuming it affects only the item currently open in the editor.

  • Identify which posts, pages or archives use the template.
  • Preview affected content before publishing.
  • Confirm that template parts and content blocks remain present and correctly placed.
  • Check the selected template in the Post/Page Settings sidebar when reviewing an individual item.
  • Recheck the layout after changing the active theme or making major site design changes.

This review is especially important when editing a template that already serves multiple items. Test the relevant content contexts and confirm that the layout matches the intended scope before treating the change as complete.

WordPress custom templates are most useful when their scope is clear. Confirm that the active theme supports the Site Editor, create the appropriate page, post, archive or Custom Template, and assign Custom Templates explicitly where required. Remember that a shared template change can affect every item using it, while template hierarchy and user-saved templates influence which layout WordPress displays. Explore our WordPress plugins, WooCommerce extensions, themes and membership plans to find the right tools for your website.

Free Worldwide shipping

You can download the products right away at wpbetterplugins.com

Immediate delivery

After the payment is credited, the product is ready for download

International Warranty

Offered in the country of usage

100% Secure Checkout

Stripe / Apple Pay / Google Pay / MasterCard / Visa

Zadzwoń