Posted on

Create a new Template

Creating a new template for WordPress is pretty straightforward. The only code you need to show that your template is not part of the standard system files is the php code at the very top of the page.

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

This code tells WordPress that you are using a custom template. When you have your template in place you can then select it on your pages section when you create a new page. You can create as many templates as you like for your site but its always good practice to keep them to a minimum.

Most of the time you will want your welcome or home page to have a different look to the rest of the site as this page will always have a lot more links and snippets of information then any other page in the site.

Now lets create the template.

First open the index page and click SAVE AS then rename it to the name of your template, lets call it homepage.php
Now close all the pages and open the new file homepage.php
At the very top of the page (before anything else) put the code above and change the words Template Name to HomePage.

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

your code should now look like this:

<?php /*
Template Name:  HomePage
*/
?>

Now upload your files and open the admin section of your site and create a page. You should now be able to select your template from the Template section of your page.

Once you have all this done you can play around with your template and get the look and feel that you want for your home page.