How to Add a New Template in WordPress
Learn how to create and assign a new WordPress page template using a child theme, PHP template labels, Page Attributes, and reusable template parts.
How WordPress Templates Shape Your Site
To add a new template in WordPress, copy a theme template, rename it, and add a template label. Then edit its PHP or block markup. Finally, assign the new template to a page from the WordPress dashboard.
A template controls the layout and design of a page or post. It decides where the title, content, image, sidebar, and footer appear. Themes use different templates for different types of content.
WordPress follows a template hierarchy when it chooses a file. It checks for the most specific match first. If that file does not exist, WordPress falls back to a broader template.
The official WordPress template hierarchy guide shows this fallback path. It helps you predict which file controls a page.
- A page may use page-about.php for one specific page.
- A page may use page.php as the general page layout.
- A post may use single.php for its main view.
- A site may use 404.php for missing pages.
Common WordPress Template Types
Classic themes use PHP files to build each view. Block themes use HTML files and the WordPress Site Editor. Both systems control page layout, but their editing steps differ.
Page templates are useful when one page needs a special look. You might remove the sidebar from a landing page. You might also create a wide layout for a portfolio or product guide.
A custom template can serve one page or a group of pages. For example, a team template could use the same layout across several staff pages. A page template gives you this control without changing every page on the site.
| Template type | Main use |
|---|---|
| Page template | Custom layout for selected pages |
| Single post template | Layout for one post or post type |
| Archive template | Lists posts by type, date, or category |
| Template part | Reusable header, footer, or content block |
| Block template | Layout file used by a block theme |
Template parts prevent repeated code. Use them for headers, footers, calls to action, and related posts. A later change then updates each place that uses the part.
How to Create a New Page Template
The safest way to make a new template in WordPress is to copy a working file. Start with a child theme, not the parent theme. Parent theme updates can erase your changes.
Open your child theme folder with your host file tool or a code editor. Copy page.php into that folder. Rename the copy to something clear, such as page-wide.php.
Add a PHP comment at the top of the new file. This comment gives the template its name in the dashboard.
<?php
/*
* Template Name: Wide Page
* Template Post Type: page
*/
get_header();
?>
Keep the comment near the top. The name after Template Name: becomes the choice shown in Page Attributes. You can then change the markup below it.
For a full-width layout, remove the sidebar call and adjust the content wrapper. Keep the theme's header and footer calls unless you want a fully separate design.
In a block theme, create a custom template in the Site Editor instead. Go to Appearance, then Editor, and open the Templates area. Choose a template type, edit its blocks, and save the result.
The WordPress custom page template documentation explains the PHP header and file rules. Check it when you need support for a custom post type.

Example: A Simple Landing Page Template
A landing page often needs a focused layout. It may show one headline, one image, and one sign-up form. Start from your theme's page file so its styles and functions still load.
Use this basic file plan:
- Copy the existing page template into your child theme.
- Rename the file with a useful, lowercase name.
- Add the template name comment at the top.
- Remove sections that the landing page does not need.
- Save the file and clear any site cache.
Assign the Template to a Page
After you create a new template, open the WordPress dashboard. Go to Pages and edit the page that needs the new layout. Look for the Page Attributes panel.
Choose your template from the Template menu. In older WordPress screens, this menu sits inside Page Attributes. In newer screens, it may appear in the page settings sidebar.
Click Update or Publish. Then view the page in a private browser window. This test avoids a cached view from your own session.
- Confirm the right page uses the new design.
- Check the page on a phone and a wide screen.
- Test the menu, forms, images, and footer links.
- Check the page source if the layout looks unchanged.
If the template menu does not appear, check the file header first. A missing or misspelled template label keeps the file hidden. Also confirm that the file sits in the active theme or child theme folder.

Editing Existing Templates Safely
You can edit an existing template when the change should affect many pages. For example, edit page.php to change the default page layout. This approach is faster than making many custom files.
Use a child theme for PHP template edits. The child theme loads its matching file before the parent theme file. This keeps your changes safe during parent theme updates.
Block theme users can edit templates through the Site Editor. Open the template, change its blocks, and save the changes. WordPress stores many Site Editor changes in the database, not only in theme files.
Template parts make large layouts easier to manage. Create shared parts for the header, footer, or post meta. Keep each part small and focused.
| Change needed | Best place to make it |
|---|---|
| One page needs a new layout | Custom page template |
| Every page needs the same change | Default page template |
| Every footer needs a new link | Footer template part |
| Block theme layout needs edits | WordPress Site Editor |
Best Practices for Page Templates
Give each template a clear purpose. Names such as Landing Page and Full Width help editors choose the right file. Avoid vague names such as New Template 2.
Organize files inside the theme folder. Keep PHP templates in a named folder when your theme supports that setup. Keep template parts in a separate folder, such as template-parts.
Do not copy huge files without checking them. Remove unused code from the new template. Smaller files are easier to test and fix.
Keep the same content hooks as the original theme when possible. These hooks help plugins add titles, forms, and other content. Removing them can break key site features.
- Use a child theme for classic theme changes.
- Back up the site before changing theme files.
- Use version control for active client or business sites.
- Test logged out, on mobile, and with a clean cache.
- Reuse template parts for shared site elements.
Use the Site Editor when you work with a block theme. Use PHP files when you work with a classic theme. Mixing both methods without a plan can make future edits confusing.

Troubleshooting New Template Problems
A new template can fail for a few common reasons. Start with the file name, template header, and active theme. These checks solve many setup errors.
If the template does not appear, confirm the PHP comment uses the exact label. The file must also use a PHP extension. A file named page-wide.html will not appear as a classic page template.
If the page shows a blank screen, look for a PHP error. Check missing brackets, broken function calls, and unmatched quotes. Restore the copied file, then add your changes in small steps.
If the page looks unchanged, clear the site and browser cache. Check the page's assigned template again. A block theme may also ignore a PHP page template.
If styles are missing, keep the theme's normal header call. Check the content wrapper and stylesheet hooks. Ask your theme documentation which hooks its layout needs.
- Missing menu: check the template label and theme folder.
- Wrong layout: check Page Attributes and the active theme.
- Broken design: keep the original wrapper and style hooks.
- Lost edits: use a child theme or Site Editor save.
Test one change at a time. That makes the cause clear and speeds up repair.
Choose the Right Template Method
Use a custom page template when only selected pages need a different layout. Use the default page template when all pages should share the change. Use template parts when several templates repeat the same section.
For classic themes, copying an existing file is the quickest safe start. For block themes, the Site Editor offers a visual path. Both methods work best when you keep files tidy and test each assignment.
Start with one small page. Build the new template, assign it, and check every screen size. Once it works, reuse its parts across the rest of the site.
Step-by-step
- 01 Create a child theme backup
Back up the site and use a child theme for classic theme files. This protects changes during parent theme updates.
- 02 Copy a working template
Copy page.php into the child theme folder. Rename the copy with a clear name, such as page-wide.php.
- 03 Add the template label
Add a PHP comment with Template Name at the top of the file. This label appears in the page editor.
- 04 Edit the layout
Change the copied markup to fit the page. Keep needed header, footer, content, and style hooks.
- 05 Assign and test the template
Select the template under Page Attributes, save the page, and test it on mobile and desktop.
Frequently asked questions
- How do I add a new template in WordPress?
- Copy a working page template into your child theme. Rename it, add a Template Name comment, and edit the copied file.
- How do I create a new template in WordPress?
- Create a PHP file in a child theme and add a Template Name comment at the top. Then choose that template in the page editor.
- How do I assign a custom page template in WordPress?
- Edit a page in the dashboard and open Page Attributes. Select the new option from the Template menu, then update the page.
- Why does my WordPress page template not appear?
- A missing template label, wrong file type, or wrong theme folder can hide the template. Check those items first.
- Should I use a child theme for a WordPress template?
- Use a child theme for PHP edits in a classic theme. Use the Site Editor for templates in a block theme.
- What are template parts in WordPress?
- Template parts hold shared items such as headers and footers. They let one change update many templates.