How to create a custom static page

In this post I will explain how to create a custom page for your blog and in my next article I will show you how to create a custom and static front page. Many site owners want to have a custom template for a specific page. Or set a custom “contact us” page with an online form without having to install a plugin. The first step is to design your customized page in your favorite HTML editor. You can use dreamweaver, fronpage or download a free HTML editor. You don’t have to know HTML programming. Just build the page in the design view of your HTML editor and then save it as PHP.

The next step is to paste some lines of code to tell WordPress that this is a custom template. For example if you named your page test.php, the template name must be “Test”. Just make sure you don’t use any of the reserved names used by WordPress (single, home, page, index, etc). You need to add these lines of code above the HTML code of your page:

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

Your HTML code goes here.


I will attach an example of a custom page here so you can look the simple structure. Once you finish creating your custom page, just upload it to the Patagonia theme folder. In your WordPress Dashboard, go to the pages section and select the page you want to customize.

On the right, you will see the attributes box. In template select the custom page you created (in this case Test) and press update. That’s all! In the next article I will explain how to set a custom static page as your front page.

6 Comments to “How to create a custom static page”

  1. By ctdriver, June 23, 2009 @ 1:09 PM

    How do I modify the material in the Template (for example, adding a link to the linkbar under the header image)? I have not been able to locate any documentation explaining the structure of the template, and I have no clue as to where things are located in the maze of php files that make up the template. Do you have any docs that explain how the whole thing works?

    Thanks.

  2. By ostrov, December 2, 2009 @ 1:00 PM

    Thank you,
    very interesting article.

  3. By Marcus, July 12, 2011 @ 5:27 PM

    I can’t get this to work in WP version 3.2. Do you have any suggestions on how to do this now?

    Marcus

    • By admin, July 13, 2011 @ 2:51 AM

      Hi Marcus. This should work on WP 3.2. The page just doesn’t show up? Or the template is missing in the dashboard? Let me know.

  • XkiD | How to create a custom static page | blog.xkid.ro — June 15, 2009 @ 7:00 PM

  • Wp Themes Planet » Create a custom static front page — June 18, 2009 @ 6:30 AM

  • RSS feed for comments on this post. TrackBack URI

    Leave a Reply