How To Create A Custom WordPress Page Template
There may be times when you want to create a blog page or that looks different than a normal page. Or Perhaps you want to use WordPress to run your entire website but want the main page of your domain to look completely different than a typical blog. This is an easy way to Customize WordPress that can be very easily accomplished by creating a custom WordPress page Template.
The first step is to create your desired page in HTML, I use an HTML editor since I am somewhat geek impaired and can’t actually write any code. In this case we are not going to add content to this page from within the dashboard so add all your meta tags for SEO. It will need a title, description, keywords, basically everything a regular static HTML page would need. After you create your new page you need to create a new WordPress page template. This can be done either in a text editor and FTP uploaded to your site or, since it is a small simple file you can create it directly in your hosting account’s control panel.
To create the new page template paste the HTML code into a text editor like Notepad, then paste the following PHP code directly above the opening <html> tag like this.
<?php
/*
Template Name: NewTemplateName*/
?><html>
Copy just the 5 lines of code above the <html> tag (don’t include <html> twice), paste it into your new template and change NewTemplateName to a name of your choosing. Save the new page template as a .php file. Something like front.php, and upload it to your hosting account in the template folder of your current WordPress theme. Don’t call your new template page.php! There is already one called that. In fact look in the themes directory to see what files exist to not create a duplicate.
The directory to place the new page template in is blog/wp-content/themes/default. Where default is the currently active theme.
Since you are placing this new [tag]WordPress[tag] page template into a specific themes folder it will only be available when that specific theme is active. If you change themes you will need to place a copy of it into the currently active theme.
To create a new page template within your hosting accounts control panel. Browse to your blogs main directory, wp-content, themes, then click on your currently active theme. Create a new PHP file, call it whatever you wish, like above front.php, paste your HTML code and then the PHP code directly above it and save.
Creating Your New Custom Page
Login to your WordPress Dashboard, click Write then Write Page. Since we didn’t specify in the custom page template to get the content, or any other information for that matter, all we need to do here is create a new page and specify the page template to use.
Type a title in the title box, then look over to the right and click the Page Template drop down box, choose your new WordPress page template and click publish.
Using A Custom Static Front Page
If you want to use a your new custom page for a static front page you will first need to create another regular page as a URL as your blogs Posts Page . Create a new page and give it the title blog, or anything you want. Again don’t bother writing any content, on the right side type the same name as the title in the Post Slug box and click publish.
To specify using a static front page, click Options then the Reading subpanel. Choose the Static Page option, specify your new custom page as the front page and the newly created blog page as the Posts Page and click Update Options.
Now your blog will show your new custom page as the front page. But what about your blog? Where did it go? If you followed my directions and used blog as the the Posts Page the URL should be YourBlogsURL.com/blog so if your blog is in a directory called blog then the URL will be YourBlogsURL.com/blog/blog. Having a blog/blog URL isn’t all that cool huh? Well this is intended for use on a website ran entirely on WordPress without a static HTML front page. But you can use a different name in the title and Post Slug when you create the new Posts Page.
Now that your have read the entire post here is a short video to explain it.
For more technical information about this subject.
Another post on my other blog about Using A Static Front Page For WordPress
Customize WordPress WordPress WordPress Video GuideIf you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
Tagged with Customize WordPress, WordPress, WordPress Video Guide
Related Posts
40 Responses to “How To Create A Custom WordPress Page Template”
Discussion Area - Leave a Comment
If you have a question about your blog please leave a link to it. Please don't ask questions like "Why don't my blog work right?" and expect an answer.Two links or less are welcome, any more and your comment will be spammed! Nofollow has been disabled, all comments are moderated and will not appear until approved. Please submit only once.
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
Or just copy the example below and change your details.
Example - <a href="http://www.YourSite.com">Title Of Site</a>










How To Create A Custom WordPress Page Template…
There may be times when you want to create a blog page or that looks different than a normal page. Or Perhaps you want to use wordpress to run your entire website but want the main page of your domain to look completely different than a typical blog. T…
Jeff demonstrates how to give your lead page options - display options, content options, format options, html options. Your web page or blog can stand apart from those of the masses.
Carl Hendricks,
http://www.cehmagic.com/blog
Hey Houdy,
Nice job!, You certainly are giving your visitors a lot of precious info. This blog will be a hit!
By the way, you got a nice voice
Gamy
Jeff,
Your websites are a great inspriration. Thank you for all of the great ideas and tips you share with everyone.
It is a pleasure to be associated with such a knowledgable and generious person.
Morris
Hi Jeff,
You provide me what I was looking for. Good work.
Wolney
Nice work Jeff
I have done a few videos myself. I need some more practice though:-)
Mal
Hi Jeff,
Great video and very useful.
I need to get some videos going myself!
Cheers
Suzanne
Great Job Jeff, that is what i was looking for
Thanks, Elsa
thanks, this was helpful
[…] for the benefit of others reading this, I have instructions about this with video on my blog here: How To Create A Custom WordPress Page Template __________________ Jeff Houdyschell WordPress […]
thanks bro!
[…] you want to customize your static front page, a related post with a video can be found here: How To Create A Custom WordPress Page Template WordPress Guide Share This Gregarious FeedFlare Sphere: Related ContentIf you’re new […]
Your tuts was very helpful and i really love it! I have a favor can you create a tuts that i can post my static page with a post of blog in single template?
Jonathan, not sure what you mean please explain in more detail.
Jeff
Check this out man click
i use your tuts in my front page the first part is a post page of welcome that was written in write page and the second layer i wanted to display a single recent blog post.
Jonathan, It looks as if you accomplished that already. Or I still don’t understand your question.
Do you want the static front page to have the top area of text that is always the same and the lower area one particular blog post or the most recent blog post, or all the recent blog posts?
Oh man you are so nice! add me on your Im hehe thanks man for your help you have a BIG HEART, Continue your good stuff! have you visit my site? have you notice the 1st layer and the 2nd layer? its the same but i wanted to in the 2nd layer i want to display my single post of my blog. But on the first layer that was the post from write>page.
Jonathan , you can do what you want the other way around. instead of having a static front page, use a plugin called sticky post that shows one post on the top of the main page and the rest under that.
Sorry but I don’t know how to code a WordPress blog to it the way you want but I bet it can be done. Head over to the WordPress.org forum and serach or ask there.
Jeff
Hi Jeff,
Great tutorial. I am planning to use a static front page and you gave me th ehelp I needed.
One question though, is there a way I can get a part of the recent posts to appear on the static page? By using the optional exerptc.
Herb, I have never done that but I am sure it is possible. I have this site setup to show the first post and then excerpts. But if you take just the excerpt code and place it in the page template it should work.
here is a post that may help a bit to get you started: http://www.wordpressmax.com/customize-wordpress/full-excerpts
[…] As you can see using a static front page to run your website can be as easy as creating a few pages and changing a few options or you could get into some custom coding to really make it stand out and be different. All of the information you need to customize your WordPress powered site can be found online and I suggest starting at wordpress.org. One of the steps is covered here: How To Create A Custom WordPress Page Template […]
[…] As you can see using a static front page to run your website can be as easy as creating a few pages and changing a few options or you could get into some custom coding to really make it stand out and be different. All of the information you need to customize your WordPress powered site can be found online and I suggest starting at wordpress.org. One of the steps is covered here: How To Create A Custom WordPress Page Template […]
[…] review of up to where I’m at: ‘How to Create a Custom WordPress Page Template’, he suggests Blogging Forum and WordPress […]
I like to think i’m learning, but when i learn one thing another comes along, 24hours in the day is just never enough, cheers for your insight
[…] To start you need to create a custom page template and I have already posted instructions about that here: How To Create A Custom WordPress Page Template. […]
Great tutorial! Applying this to my theme right now - can finally finish and get it published. Thank you!!!
I have been visiting this site a lot lately, so i thought it is a good idea to show my appreciation with a comment.
Thanks,
Jim Mirkalami
Your awesome. A sincere thanks. I’ve been wanting to customize my blog for a long time. I rss-ed you too. Thanks!
Great article!
Just used this to implement a custom page on one of my site. May I add that there is some plugins that would allow to easily put a page as a static homepage.
Now saying that, I still had a problem since my menu was showing all the pages. So I used the King Page widget that would allow you to choose which pages to include and which to exlude.
Thanks again,
http://www.workathomechannel.com/blog
I like your blog theme. I want to use it on my blog.
Can you please tell me from where I can download these theme?
Many thanks
——————————————————————————–
Dan owner of the future gadgets blog future gadgets and inventions
Dan, most themes have a link to the designer in the footer and so does mine. The theme is called Networker but mine has been heavily modified. You can find it here:
http://antbag.com/themes/
great site , hopefully you get alot of visitors
New to this blog and looking forward to posting some useful info. Also enjoyed what is posted so far. Thanks to everyone.
Thanks, this was very useful - esp the video
hello,
I was wondering, can I have a page with a blog structure? Well my homepage has a blog structure, but I want to have another page in the same site to have a blog structure too.
I tried to make a template like the ‘index.php’ file, but It didn’t work.
Can you help me?
Twitter I am not sure what you mean. You can create another page in the WordPress dashboard that will look like your blog. But to create a static html page that matched your blog, if that is what you want, can be done, I guess, but that is well beyond what I can explain in a comment or probably in a post. There are just too many variables involved.
well let me see if I can explain what I mean in a better way.
I want to have a dynamic page where I can post several posts, something like your home page ‘http://www.wordpressmax.com/’.
Twitter, You can use a feed from your blog to supply content to a static html page if that is what you mean.
You a genious, thank you!!!!!
Great post - very helpful. Thanks a lot!