Step-by-Step: How to Add a Template in WordPress

Rachel Jul 09, 2026

Adding a template to your WordPress website can significantly streamline your content creation process and ensure consistency in your design. Templates allow you to create a master layout that you can apply to multiple pages, posts, or custom post types. Here's a step-by-step guide on how to add a template in WordPress.

How to Create a Custom Page in WordPress
How to Create a Custom Page in WordPress

Before we dive in, ensure you have a basic understanding of PHP and HTML, as WordPress templates are written in these languages. Also, it's crucial to have a backup of your website before making any changes to your theme files.

How to create a custom page template in WordPress
How to create a custom page template in WordPress

Understanding WordPress Templates

WordPress templates are PHP files that control the display of your website. They define the structure and layout of your content. The most common templates are index.php (for displaying blog posts) and single.php (for displaying individual posts).

How I Built My Own WordPress Site In 11 Steps
How I Built My Own WordPress Site In 11 Steps

You can create custom templates for specific purposes, like displaying a portfolio or a custom post type. These custom templates should be placed in your theme's folder, following the template hierarchy rules.

Creating a Custom Template

how to add a new page in WordPress
how to add a new page in WordPress

To create a custom template, follow these steps:

  1. In your WordPress dashboard, navigate to Appearance > Theme File Editor.
  2. Select the theme you're currently using from the dropdown menu on the right.
  3. Under 'Theme Files', click on 'Theme Templates' to expand the list of template files.
  4. Click on 'Add New' at the bottom of the list.
  5. Give your template a name, such as 'template-custom.php'.
  6. Add the following code to your new template file:

```php

The Ultimate WordPress Tutorial for Beginners: An Easy WordPress Guide
The Ultimate WordPress Tutorial for Beginners: An Easy WordPress Guide

2, ) ); else : get_template_part( 'template-parts/content', 'none' ); endif; ?>

```

The code above creates a basic template that displays a list of posts. You can customize this template by adding your desired layout and design elements.

Using Your Custom Template

Once you've created your custom template, you can use it for any post or page. Here's how:

Templates Wordpress Gratuit : ma sélection 2017
Templates Wordpress Gratuit : ma sélection 2017
  1. In your WordPress dashboard, navigate to the post or page where you want to use the custom template.
  2. Click on 'Edit' next to 'Template' in the 'Page Attributes' section on the right.
  3. Select your custom template from the dropdown menu.
  4. Click 'Update' to save your changes.

Now, your custom template will be applied to the selected post or page.

How to Make a Website with WordPress (Step-by-Step Beginner Guide)
How to Make a Website with WordPress (Step-by-Step Beginner Guide)
How to Create a Page in WordPress - MintSwift
How to Create a Page in WordPress - MintSwift
How To Add A New Page To Your WordPress Website
How To Add A New Page To Your WordPress Website
WordPress Website Checklist 2026 (Beginner to Pro Guide)
WordPress Website Checklist 2026 (Beginner to Pro Guide)
How to Make a WordPress Website: the Best Guide for Beginners
How to Make a WordPress Website: the Best Guide for Beginners
Wordpress Web Design 101: 10 Do's and Dont’s for Beginners
Wordpress Web Design 101: 10 Do's and Dont’s for Beginners
Complete WordPress Website Tutorial Step By Step!
Complete WordPress Website Tutorial Step By Step!
How to create a website with wordpress.
How to create a website with wordpress.
How to Add an About Me Section to Your WordPress Sidebar - Without a Plugin - WPkind
How to Add an About Me Section to Your WordPress Sidebar - Without a Plugin - WPkind
How to Start a Website using WordPress
How to Start a Website using WordPress
50+ FREE WordPress themes | WordPress theme for coaches & bloggers
50+ FREE WordPress themes | WordPress theme for coaches & bloggers
How To Build WordPress Website: Step-By-Step Guide
How To Build WordPress Website: Step-By-Step Guide
Beautiful Dawn Designs - Easy Crochet Patterns
Beautiful Dawn Designs - Easy Crochet Patterns
Wordpress for beginners (step by step guide)
Wordpress for beginners (step by step guide)
How to create a wordpress website from scratch
How to create a wordpress website from scratch
WordPress website for beginners - 2026 Guide
WordPress website for beginners - 2026 Guide
WordPress Tips - How to Create a File Upload Form
WordPress Tips - How to Create a File Upload Form
How To Add A Contact Me Page To Your WordPress Blog - WPkind
How To Add A Contact Me Page To Your WordPress Blog - WPkind
Complete Step-By-Step Guide to Adding and Publishing a Blog Post on WordPress
Complete Step-By-Step Guide to Adding and Publishing a Blog Post on WordPress
How to Include or Override WordPress Templates - Igor Benić
How to Include or Override WordPress Templates - Igor Benić

Creating a Custom Template with a Plugin

If you're not comfortable editing theme files directly, you can use a plugin to create custom templates. One such plugin is 'Ultimate Posts'. Here's how to create a custom template using this plugin:

After installing and activating the plugin, follow these steps:

  1. Navigate to 'Ultimate Posts' > 'Templates' in your WordPress dashboard.
  2. Click on 'Add New' to create a new template.
  3. Give your template a name and select the post types you want to apply it to.
  4. Use the visual editor to design your template. You can add custom fields, loops, and other elements using the plugin's shortcodes.
  5. Click 'Publish' to save your template.

Now, you can apply your custom template to any post or page using the 'Template' dropdown menu in the 'Page Attributes' section.

Customizing the Template Design

Once you've created your custom template, you can further customize its design by adding custom CSS. You can do this by adding your custom CSS to your theme's stylesheet or using a plugin like 'Simple Custom CSS' to add custom CSS without editing your theme files.

To add custom CSS to your template using a plugin, follow these steps:

  1. Install and activate the 'Simple Custom CSS' plugin.
  2. Navigate to 'Appearance' > 'Custom CSS' in your WordPress dashboard.
  3. Add your custom CSS to the text area and click 'Update'.

Your custom CSS will now be applied to your custom template.

Adding a template to your WordPress website can greatly enhance your design and content creation process. By following the steps outlined above, you can create and use custom templates to suit your specific needs. Whether you're creating a portfolio, a custom post type, or a unique page layout, custom templates provide a powerful way to control the display of your content. So, go ahead and start exploring the world of WordPress templates!