How to Create a Page Template in WordPress

by Sandeep on April 6, 2010

You can write either posts or pages in WordPress. When you are writing a regular blog entry, it appears in the homepage. Whereas Pages are useful for writing “About Me”, “Contact Us”, “Privacy Policy” etc etc., You can use pages to organize any amount of content. In a simple way, Pages are very similar to posts, which contain Titles, Content. But you can customize the Page Template.

Don't forget to subscribe to our rss How to Create a Page Template in WordpressFEED! Subscribe via email How to Create a Page Template in WordpressEMAIL.

For instance, if you want Header and Footer without a sidebar, You can use custom Page Templates. So lets learn how to do this.

First of all you need to take your favorite text editor like notepad and copy the code below:

<?php
/*
Template name: Custom
*/
?>

Then add content to the page.
Eg

<html>
<body>
Your content here
</body>
</html>

Now combine both the codes, save it with *.php extension and upload it to your Current Theme* directory. The combined code look like:

<?php
/*
Template Name: Custom
*/
?>
<html>
<body>
Your Content here
</body>
</html>

Don't forget to subscribe to our rss How to Create a Page Template in WordpressFEED! Subscribe via email How to Create a Page Template in WordpressEMAIL.

You can complete this process in
1. Login to your site admin panel.
2. Under Pages, Click on Add new.
3. Add a new page and give a Title to that page.
4. Under attributes section, You can see Template Option.
5. From the drop list, Select our newly created page template, i.e, “My Test Template”.
6. You are done!! Publish your Page.

- You can also add header and footer to your page by using the code below:

<?php
/*
Template Name: Custom
*/
?>
<?php get_header(); ?>
Your Content here
<?php get_footer(); ?>

We'll send more interesting posts like How to Create a Page Template in WordPress to you!
Enter your Email Address:
Join us on Facebook.

  HostGator
    

{ 11 comments… read them below or add one }

Rajesh Kanuri @ TechCats April 6, 2010 at 1:10 pm

Its a nice and simple post
.-= Rajesh Kanuri @ TechCats´s last blog ..[Thesis Tutorials] How To Remove Comments From Thesis Home Page =-.

Reply

Siddartha April 6, 2010 at 1:41 pm

thnx a lot bro. Glad you liked it. Stay tuned for more Updates :)

Reply

Free Samples April 9, 2010 at 6:06 pm

I usually don’t usually post on many Blogs,but I love your blog, I often read here, still I just has to say thank you… keep up the amazing work.

Reply

PHP Tutorial May 7, 2010 at 11:57 pm

You can write either posts or pages in Wordpress.

Reply

Admerson May 19, 2010 at 6:24 am

Its a nice and simple post 2

Reply

Mary September 11, 2010 at 2:02 pm

Thanks a lot! I’m still waiting for some interesting thoughts from your site in your posts.

Reply

Akshay December 10, 2010 at 7:54 pm

wow thanks a lot ! I will try it right now !

Reply

Brankica December 15, 2010 at 9:51 am

I was wondering about this and I am really scared of coding in WP but I will definitely give it a go and try to make a custom template like this.
Thanks.

Reply

Charlie January 28, 2011 at 2:32 am

Thank you for the useful information.
I like your blog.

Reply

bruce February 24, 2011 at 4:01 pm

Thank you for the useful information.
I like

Reply

odzywki September 5, 2011 at 9:11 pm

Thank you, I have recently been looking for information about this topic for ages and yours is the best I have discovered till now. But, what about the bottom line? Are you sure about the source?

Reply

Leave a Comment

{ 1 trackback }

Previous post:

Next post: