How to Create and Manage Multiple Custom Templates in Twenty Twenty-Four
Content
Many users of the Twenty Twenty-Four theme want to create different layouts for different types of content, such as posts in specific categories or pages with unique headers and footers. A common challenge is understanding how to create these custom templates and then successfully apply them where needed.
This guide explains the core concepts and provides step-by-step solutions for managing templates in the Twenty Twenty-Four theme.
Understanding Templates in the Site Editor
The Twenty Twenty-Four theme is a block-based theme, which means it uses the Site Editor (Appearance > Editor) for design control. Templates define the structure of your pages and posts, including elements like headers, footers, and sidebars.
Confusion often arises from the distinction between:
- Site Editor Templates: Found under Appearance > Editor > Templates. These are the design blueprints.
- WordPress Pages: Found under Pages > All Pages. These are the individual pieces of content that use a template for their layout.
When you edit a template in the Site Editor, you are changing the layout for every page or post that uses it.
How to Create a New Custom Template
- Navigate to Appearance > Editor > Templates.
- Click the + button (Add New Template) in the top right corner.
- Select the type of template you want to create (e.g., Page, Post, Archive).
- Give your new template a clear, descriptive name (e.g., "Recipe - Baked").
- Design your template using blocks. You can start from scratch or duplicate and modify an existing template.
- Save your changes.
Why Can't I See My Custom Template When Editing a Page?
This is a frequently reported issue. A custom template will only appear in the selection menu for a page if it was created for the correct content type. For example, a template created as a "Post" template will not be available to assign to a "Page." Double-check that you created the right kind of template.
How to Apply a Template to Multiple Items at Once
You do not need to change templates one-by-one for a large number of posts or pages.
- Go to Posts > All Posts or Pages > All Pages.
- Select the checkboxes for all items you want to modify.
- From the Bulk Actions dropdown, select Edit and click Apply.
- A bulk edit menu will appear. Locate the Template dropdown.
- Select your desired custom template and click Update.
This will apply the template to all selected items in a single action.
Setting a Global Default Template (Advanced)
As noted in the threads, there is no built-in WordPress setting to define a custom template as the new global default for all future posts. The default "Single" post template is hardcoded. To achieve this, you would need to create a child theme and use custom code to override the default template hierarchy, which is beyond the scope of basic troubleshooting.
Key Takeaways
- Create templates for the specific content type (Page, Post) you need them for.
- Use the Bulk Edit feature to apply a template to many items simultaneously.
- Editing a template in the Site Editor changes every page/post that uses it.
- For site-wide changes like a global background image, custom CSS remains the most straightforward solution.
Related Support Threads Support
-
How to apply a template’s layout to other templates?https://wordpress.org/support/topic/how-to-apply-a-template-to-other-template/
-
Can I have two single post templates?https://wordpress.org/support/topic/can-i-have-two-single-post-templates/
-
Child Theme – Front Pagehttps://wordpress.org/support/topic/child-theme-front-page/
-
can’t choose my own page templatehttps://wordpress.org/support/topic/cant-choose-my-own-page-template/
-
Need Help creating a reusable page layouthttps://wordpress.org/support/topic/need-help-creating-a-reusable-page-layout-2/
-
Cloning and applying templateshttps://wordpress.org/support/topic/cloning-and-applying-templates/
-
Synced layout?https://wordpress.org/support/topic/synced-layout/
-
Problem with Custom Page Template and Navigation / Headerhttps://wordpress.org/support/topic/problem-with-custom-page-template-and-navigation-header/
-
How to create and select different custom post templateshttps://wordpress.org/support/topic/how-to-create-and-select-different-custom-post-templates/
-
Swap Templates in child theme setup?https://wordpress.org/support/topic/swap-templates-in-child-theme-setup/
-
Articles list resume and full article pagehttps://wordpress.org/support/topic/articles-list-resume-and-full-article-page/
-
Proper setup before building a business websitehttps://wordpress.org/support/topic/proper-setup-before-building-a-business-website/
-
Create new Style in the Style bookhttps://wordpress.org/support/topic/create-new-style-in-the-style-book/
-
How to switch default post tyephttps://wordpress.org/support/topic/how-to-switch-default-post-tyep/
-
which template for the summary posts landing pagehttps://wordpress.org/support/topic/which-template-for-the-summary-posts-landing-page/
-
How can I select the “Archive” template for a newly created page?https://wordpress.org/support/topic/how-can-i-select-the-archive-template-for-a-newly-created-page/
-
changing templatehttps://wordpress.org/support/topic/changing-template-7/
-
Dual Article/Category Pageshttps://wordpress.org/support/topic/dual-article-category-pages/
-
What’s the purpose of Site Editor Pageshttps://wordpress.org/support/topic/twenty-twenty-four-whats-the-purpose-of-site-editor-pages/
-
How can I use the featured image as a cover image with title/texthttps://wordpress.org/support/topic/how-can-i-use-the-featured-image-as-a-cover-image-with-title-text/
-
Form patternhttps://wordpress.org/support/topic/form-pattern/
-
Clone “Page no Title” templatehttps://wordpress.org/support/topic/clone-page-no-title-template/
-
Home Page, Blog Home and Front Pagehttps://wordpress.org/support/topic/home-page-blog-home-and-front-page/
-
Assign posts to city (location)https://wordpress.org/support/topic/assign-posts-to-city-location/
-
Template: Edit Site vs. Edit Pagehttps://wordpress.org/support/topic/template-edit-site-vs-edit-page/
-
sidebar slips under the main columnhttps://wordpress.org/support/topic/sidebar-slips-under-the-main-column/
-
background image for each templatehttps://wordpress.org/support/topic/background-image-for-each-template/
-
How do I disable the “Choose a pattern”?https://wordpress.org/support/topic/how-do-i-disable-the-choose-a-pattern/
-
How is “replace template” feature set in 2024 theme?https://wordpress.org/support/topic/how-is-replace-template-feature-set-in-2024-theme/
-
The default layout for entrieshttps://wordpress.org/support/topic/the-default-layout-for-entries/
-
Can’t Swap Templates in Page Editorhttps://wordpress.org/support/topic/cant-swap-templates-in-page-editor/
-
How to revert a Template back to default after editing ithttps://wordpress.org/support/topic/how-to-revert-a-template-back-to-default-after-editing-it/
-
how to find start page in dashboard, edit ithttps://wordpress.org/support/topic/how-to-find-start-page-in-dashboard-edit-it/
-
Preview for templates page two not openablehttps://wordpress.org/support/topic/preview-for-templates-page-two-not-openable-2/
-
Three column templatehttps://wordpress.org/support/topic/three-column-template-2/
-
Is there a way to use/apply theme templates?https://wordpress.org/support/topic/is-there-a-way-to-use-apply-theme-templates/
-
How to change the default template for postshttps://wordpress.org/support/topic/how-to-change-the-default-template-for-posts/
-
Converting Site to a pagehttps://wordpress.org/support/topic/converting-site-to-a-page/
-
Duplicate Template Parts & Patternshttps://wordpress.org/support/topic/duplicate-template-parts-patterns/
-
Set template on a pagehttps://wordpress.org/support/topic/set-template-on-a-page/