WP Hosting Blog

Best practice WordPress hosting, development and management

2018-02-08T22:24:43+00:00 July 10th, 2009|WordPress Hosting & Development|By WP Hosting Team|

Creating Page Templates for WordPress

Ok, now this only applies to people who know how to use FTP to access the files on their site.

If you don’t know about FTP I suggest playing with a development site first as data loss can happen!

Let’s say we want to make 2 kinds of templates for pages.  Perhaps one page has the page heading and one does not (however you can change pretty much anything you want as long you keep the header, sidebar and footer references).

First of all, make a duplicate of the index.php or page.php file and rename it to something like page2.php (can be anything really).

Now, this is the important bit to let WordPress know the template exists.  You will need to add the following code to the very top of the file:

<?php
/*
Template Name: Page 2
*/
?>

Now make the changes to the template and save it in your template directory.  You can do things like remove sidebars, change content sizing, etc…

Login to WordPress (any current version) and select the page you wish to use the template for.  You will now notice a template section in your edit page (or quick edit) where you can select from available templates for that page.  Select the template and save your page.

Easy as that!