WordPress Page Templates
A couple of weeks ago I was trying to get a design out so a client could review it and let us know if they wanted us to keep working on the design. Fortunately they did! I was struggling to try and figure out how I could have pages with a different template design. I wanted to have a sidebar on one section of the website with a list of subpages. I knew there was a way to do it. I had heard of it before but I couldn’t quite figure it out. I then looked through the WordPress documentation and learned about WordPress page templates and how to create them! I was relieved because I was then able to quickly get a different template for a few pages put together.
It’s really easy to do. At the top of a PHP file in your theme’s root directly, place the following code:
-
<?php
-
/*
-
Template Name: Facts
-
*/
-
?>
Then of course you’ll pull your header, sidebar, footer and other div elements just like you normally would. After you have gotten it put together upload the file into your theme directory. Go into your WordPress administration area and edit or create a new page. On the side click on the plus sign beside page template, use the drop down to choose your newly created page template. If you were already on the page before you uploaded you may have to refresh.
Tags: page templates, theme design, web design, wordpress, wordpress design
December 11th, 2007 at 11:50 pm
I had read your article previously, and then I had forgotten it, but I ended up going through the WP documentation and found out how again..(before coming back to this article again, lol)
It really is a cool feature, and now that I’ve tried it out, I have so many ideas coming to mind for future projects! :p
Yay @ WordPress…
December 12th, 2007 at 2:02 am
Luke (sexyer1) - I’m glad you were able to find it again. Let me know if there is anything I could write a blog entry about that might help you. Does it sound like I’m desperate for blog topics, lol? I promise I’m not, I just enjoy helping people out if I know how to do something.