Blog > Tutorials > WordPress Tutorials > WordPress Creating a Custom Page Template

WordPress Creating a Custom Page Template

05.19.2009 Bookmark and Share

Creating a custom page template in WordPress is extremely easy, simply add this code at the top of your page template. Generally the best way to create a custom page template is by creating a copy of your theme’s page.php file. Using the existing page template will be a good starting point for most customizations, since most likely many aspects of the custom page will be similar to the original. Also, it’s much easier to hack away at your code removing sections of a page rather than trying to add them back in.

The Code:
[php]
<?php
/*
Template Name: Your Template Name
*/
?>
[/php]
Most likely right after the page template code will come <?php get_header(); ?> . As a side note, there doesn’t need to be any correlation between the filename and page template name.

Sam Morris WordPress Tutorials

  1. March 18th, 2011 at 05:41 | #1

    Handsome aggregation of templates ! The last is beautiful and I will load now in my new wordpress site without css alteration.

  1. No trackbacks yet.