How to Create Page Views Using WordPress Templates

A static WordPress page contains content that doesn’t appear on your blog page, but rather as a separate page within your site. You can have numerous static pages on your WordPress site, and each page can have a different design, based on the template you create. You can create several static-page templates and assign them to specific pages within your site by adding code to the top of the static-page templates.

Using a template on a static page is a two-step process: Upload the template, and then tell WordPress to use the template by tweaking the page’s code.

Uploading the template

To use a page template, you have to create one. You can create this file in a text-editor program, such as Notepad. To create an About page, for example, you can save the template with the name about.php.

When you have your template created, follow these steps to make it part of WordPress:

  1. Upload the template file to your WordPress theme folder.

    You can find that folder on your web server in /wp-content/themes.

  2. Log in to your WordPress Dashboard and click Editor in the Appearance drop-down list.

    The Edit Themes page opens.

  3. Click the about.php template link located on the right side of the page.

  4. Type the Template Name tag directly above the get_header() template tag.

    The header tag looks like this: <?php get_header(); ?>.

    If you’re creating an About Page, the code to create the Template Name looks like this:

    Template Name: About Page
  5. Click the Update File button.

    The file is saved, and the page refreshes. If you created an About Page template, the about.php template is now called About Page in the template list on the right side of the page.

    The Page template displays the code needed to define a specific name for the template.
    The Page template displays the code needed to define a specific name for the template.

Assigning the template to a static page

After you create the template and name it the way you want it, assign that template to a page by following these steps:

  1. Click Add New in the Pages drop-down list.

    The Add New Page page opens, where you can write a new post to your WordPress blog.

  2. Type the title in the Title text box and the page content in the large text box.

  3. Select the page template from the Page Template drop-down list.

    By default, the Page Template drop-down list in the Attributes module appears on the right side of the page. You can reposition the modules on this page.

  4. Click the Publish button to save and publish the page to your site.