Please feel free to subscribe using either RSS or Email to stay upto date with the latest news.

RSS for 42k Wordpress Theme
RSS for Factory42
RSS for Factory42
 

All Delivered by FeedBurner

Using a seperate template for pages in Wordpress

Pages in Wordpress can have different styles and layouts by way of using different templates. This can be really useful if your using Wordpress as more of a static website, or even if your just using it as a dynamic blog and want a different layout for some static pages.

First thing to do is to create a new page template, I would suggest a good place to start in this is to make a new copy of page.php and rename it to something you will remember, this new file will be the basis of your new page design. So in that new copy, change anything you want, adding and removing to your hearts content.

When you have finished, you will need to add this code at the top of the new pages code:

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

This code defines the new name of the page template that will show up in the admin section of your WP blog so replace NewPageTemplate with something a bit more meaningful!

You can make as many different page designs as you want this way, just keep changing the NewPageTemplate name so you don’t get confused in the admin section.

Once you have named your new page open the admin section of your site and go to either create a new page, or edit an old one.

On the right hand side you will see an ATTRIBUTES section, with a template drop down box below it as seen in the image below.

There you can click on the drop down box and see all of the new page templates you have created (Image below) simply select the one you want and your off. As you can see some of the names on this site I’m working on are fairly random but its not seen by the public so I tend to be fairly messy in my naming conventions!

So nice and simple way to create a new page template!


You must be logged in to post a comment.