How To Create A Custom WordPress Page Template

image 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.

To create the new page template paste your HTML code into a text editor like Notepad, then paste the following PHP code directly above it like this:


<?php
/* Template Name: New Template Name
*/
?>
<html>
Your HTML Code Here or the rest of HTML code

Copy just the above lines of code above the <html> tag and paste it into your new template and change New Template Name to a name of your choosing. Save the new page template as a .php file. Something like FirstPage.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.

Now, I had also an issue where I was trying to create a custom page in WordPress 3.0.2 where I was not able to select template not it was not available. Likewise, I was I was not able to find articles talking about this issue.

image

So, if you don’t see a template listed in your new page creation simple create a php page with above code in the header of the file and transfer into the theme folder of WordPress and the next time you edit or create a new template your should be able to select as template.  I had issues when I was trying to create a page when Google searches will land and the instructions will tell you create a new page but the new page has to be created base out of a template because you template page will help the Google search-result-code.



About onlinejt

Blogger

,

No comments yet.

Leave a Reply

*