To create a custom single-post template in WordPress, first identify whether the active theme is a block theme or a classic PHP theme. Then match the template to your scope: edit the general Single Posts template for every post, assign a registered custom template to selected posts, or use a post-type-specific template for a custom post type. Block themes use the Site Editor and HTML files; classic themes use PHP files selected through the template hierarchy.
Antihost offers managed WordPress hosting with free migration, one-click staging and a 14-day free trial.
Start with the two decisions that determine everything
Identify the theme architecture
WordPress has two template systems. A block theme stores templates as HTML files and exposes them through the Site Editor. A classic theme stores templates as PHP files, such as single.php, and relies on PHP template hierarchy rules. The same visual goal therefore uses different files, editors and assignment methods.
As an Amazon Associate I earn from qualifying purchases.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →In the WordPress dashboard, open Appearance → Editor. If the Site Editor exposes templates and template parts, the site is using a block-theme workflow. If the theme instead exposes theme files or the familiar Customizer without a template list, treat it as a classic theme. Labels can vary slightly by WordPress release and theme, but the deciding factor is whether the active theme supplies block templates and the Site Editor.
Define the scope before touching a file
Decide which of these outcomes you actually need:
- One default layout for ordinary posts: change the Single Posts template in a block theme or
single.phpin a classic theme. - A different layout for one or a few selected posts: create or register an assignable custom template in a block theme, then choose it in the post editor. In a classic theme, a slug-specific hierarchy file can target an individual post, although that approach is less convenient when many posts need the same design.
- A separate layout for a custom post type: use a post-type template such as
single-{post_type}.phpin a classic theme, or register an assignable block template for the relevant post type.
Choosing the narrowest scope that solves the problem prevents a special article design from changing every post on the site and avoids a theme full of nearly identical templates.
#1 Best Overall
Choose the right route
| Need | Block theme | Classic theme |
|---|---|---|
| Default design for all standard posts | Edit the Single Posts template in the Site Editor; the saved user template takes precedence over the bundled theme file. | Create or edit single.php. |
| Design assigned to selected posts | Create an allowed custom template from the post editor or register one in theme.json, then assign it to the post. |
Use a more specific hierarchy filename, such as single-{post_type}-{post_name}.php, when a file-level exception is appropriate. |
| Distinct custom post type | Register an assignable template for that post type and make it available in the editor. | Use single-{post_type}.php; a slug-specific file is more specific. |
| Where the template lives | Site Editor database template, child-theme /templates, or active-theme /templates. |
PHP template files in the child or active theme. |
Create a custom template in a block theme
Edit the site-wide Single Posts template
This is the correct route when every ordinary post should share the new structure.
- Open Appearance → Editor, then open Templates.
- Select Single Posts (the exact label may be translated or customized by the theme).
- Arrange the blocks that make up the post: for example, the post title, featured image, metadata, content, comments and related navigation. Keep the template’s existing block structure unless you have a reason to replace it.
- Save the template. A template saved in the Site Editor becomes a user-created database template and takes precedence over the same template supplied by the theme.
- Open several posts that use the template and check the title, content, images, comments and navigation at the widths your site supports. This verifies that the intended posts are using the edited template rather than a more specific assignment.
Editing this template changes the posts that use it; it does not rewrite the theme’s original file. That distinction matters when you later switch themes or remove the database customization.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Create a template from the post editor for a selected post
WordPress documents a Template Editor flow in which a post’s template control can create a template. The create option appears only when the active block theme permits custom templates.
- Open the post you want to customize in the block editor.
- Open the post’s template control in the settings sidebar.
- Choose the option to create a new template, if the theme exposes it, and give the template a descriptive name.
- Build the layout with blocks and save it.
- Leave the post assigned to that template. Other posts continue using the general Single Posts template unless you assign them the same custom template.
If the create option is missing, the theme may not allow user-created custom templates. Editing Single Posts still works for the broad default, but an individually assigned design requires a template that the theme has made available.
Ship a reusable template in the theme
Theme authors can distribute block templates as HTML files in the theme’s /templates directory. Use a filename recognized by the block template hierarchy, such as single.html for the general single-post fallback. A child theme can supply its own file without changing the parent theme’s copy.
Rank #2
Assignable templates need two pieces: the HTML template file and a registration in theme.json under customTemplates. A minimal registration pattern is:
Free tools Windows power users keep installed
One-click scans. No signup required.
{
"version": 3,
"customTemplates": [
{
"name": "single-featured",
"title": "Featured single post",
"postTypes": ["post"]
}
]
}
The registration name should correspond to the template’s identity, while the title is the label editors see. Limit the postTypes list to content types that should be allowed to use the design. Confirm the supported theme.json version and property names against the WordPress developer documentation for the release you support before distributing a theme.
Understand block-template precedence
The block hierarchy looks for user-created database templates first, then templates in a child theme, then templates in the active theme. For a general single post, the fallback sequence includes single.html, singular.html and finally index.html. A more specific template or an editor customization therefore wins over a less specific file.
This explains two common surprises. A new single.html file may appear to do nothing when a user-edited Single Posts template already exists. Conversely, deleting the database customization can reveal the child-theme file beneath it without any change to the file itself.
Create a custom template in a classic theme
Use a child theme for persistent PHP changes
If the site runs a parent classic theme that receives updates, place your customized template in a child theme. This is practical update-safety guidance rather than a WordPress requirement: a child theme keeps your replacement file separate from the parent theme’s update payload.
Rank #3
Before editing, copy the parent theme’s relevant template into the child theme while preserving its relative location and filename. Start from the theme’s existing structure rather than replacing it with a generic file. Themes often contain required calls, wrappers and hooks that keep headers, footers, sidebars and styling consistent.
Change every ordinary post with single.php
For a classic theme’s normal posts, the general template file is single.php. Copy it to the child theme, then modify the markup and template calls needed for the new layout. Preserve the theme’s loop and surrounding structure unless you deliberately understand what each part does.
After saving the file, open a representative post. Check posts with and without featured images, excerpts, galleries, comments and long titles so that the new layout handles the content variations the old template supported.
Target a custom post type
For a custom post type named book, the conventional file is single-book.php. WordPress uses the post type slug in the filename, so use the registered post type identifier rather than the display label. If one specific item needs a further exception, add its slug: single-book-the-hobbit.php.
Keep the post-type template focused on the differences that justify it. If the design is identical to ordinary posts except for one field, a small conditional or a block variation may be easier to maintain than a second full template.
Rank #4
Target one post by slug
The most specific classic filename is single-{post_type}-{post_name}.php. For a standard post with the slug season-preview, that becomes single-post-season-preview.php when the post type is explicitly part of the filename pattern; for ordinary posts, WordPress’s documented hierarchy also recognizes the post-specific form used by the active theme’s hierarchy rules. Because slug-based files are easy to misname and proliferate, verify the exact hierarchy pattern for your WordPress version and use them only for genuinely exceptional posts.
Know the classic hierarchy order
For a single custom post type, WordPress checks the most specific post-type-and-slug template first, then the post-type template, then the general single template, then the singular fallback and finally the index fallback:
single-{post_type}-{post_name}.phpsingle-{post_type}.phpsingle.phpsingular.phpindex.php
The first matching file wins. A perfectly edited single.php cannot override a matching, more specific file above it in the sequence.
Build a template without creating maintenance problems
Keep the default template as the baseline
Start by copying the existing layout and changing only the parts that need to differ: a hero area, author panel, game metadata, spoiler warning, custom field group or related-post section. This preserves the theme’s established wrappers and reduces the chance that one template behaves differently from the rest of the site.
Use names that explain assignment
A name such as “Review single” tells editors why a template exists; “Template 3” does not. Use a clear title in theme.json and a matching, readable filename. For a block theme, reserve custom templates for repeatable editorial categories rather than one-off experiments.
Best Value
Separate visual changes from content-type logic
If a template is different because the content type has a different data model, give that type its own template. If it is different only because one post is featured, an assignable template is usually a better fit. This keeps the hierarchy predictable and makes later redesigns easier.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Diagnose a template that is not being used
The new block file has no visible effect
- Check whether a user-created template with the same purpose is saved in the Site Editor. Database templates take precedence over theme files.
- Confirm the file is inside the active theme’s or child theme’s
/templatesdirectory and uses a recognized filename. - Open the post’s template control and check whether it is assigned to a different custom template.
The custom-template option is missing
Creating a template from the post editor depends on a block theme that permits custom templates. A classic theme will not expose this block-template control, and a block theme can choose not to provide the option. In that case, use the general Single Posts template or have the theme author register an assignable template through theme.json.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsThe classic file is ignored
- Check the filename character by character, including the post-type slug and post slug.
- Look for a more specific file higher in the classic hierarchy; it may be the template WordPress is selecting.
- Confirm that the file is in the active child theme, not merely in an inactive parent or another theme directory.
An update removed the customization
If a parent classic theme update replaced your edited file, move the customization into a child theme and copy the updated parent template only when you intentionally want to merge upstream changes. For block themes, remember that Site Editor changes live in the database while files in a child theme or active theme live in the theme package; each layer has a different update and deployment path.
Apply the method to common WordPress scenarios
All posts need a new article layout
Use Single Posts in the Site Editor for a block theme, or single.php in a classic theme. Do not create a separate template for each post: the general template is precisely what the hierarchy is designed to serve.
Only reviews need a different layout
If reviews are a custom post type, use the type-specific route: register and assign a block template for that type, or create single-review.php in a classic theme. If reviews are ordinary posts, use an assignable block template and select it only on review posts, or use a carefully limited classic exception.
One launch announcement needs a special design
In a block theme, create a custom template from the post editor if the theme allows it and leave other posts on Single Posts. In a classic theme, a slug-specific file can work, but remove it when the campaign ends rather than allowing temporary exceptions to accumulate indefinitely.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallA practical verification checklist
- Have you identified the active theme as block or classic?
- Does the scope match the requirement: all posts, selected posts or a custom post type?
- For a block theme, did you check the Site Editor for an existing user-created template before adding a file?
- For a classic theme, is the customized PHP file in the child theme when the parent is updateable?
- Does the filename exactly match the relevant hierarchy rule?
- For an assignable block template, is it registered under
customTemplatesand limited to the intended post types? - Have you opened representative posts and confirmed that the expected template, content and navigation appear?
- Have you avoided creating a second template where a small, maintainable change to the default would solve the problem?
Which approach should you use?
Use the Site Editor when the active theme is a block theme and the change belongs to the site’s visual system. Use a theme file when you are authoring or deploying a repeatable block template, and register it when editors must assign it to selected content. Use single.php for the classic default, a post-type filename for a distinct custom post type, and a slug-specific file only for a true one-off.
WordPress documentation current to 30 September 2026 describes the same underlying rule in both architectures: the most specific available template wins. Once you know which layer is supplying the winning template—database, child theme or active theme—you can create the desired layout without guessing which file WordPress will load.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




