large shade tree

Navigation

Information

Recent Posts

Shade Tree Sites |Building Better Websites

WordPress Custom Page Templates

In many cases, particularly if you are using your WordPress as a CMS, there comes a time when you need a website page that looks different than the default page of your theme. Examples would include a custom homepage, splash page, map page, links page etc. WordPress makes this very easy.

To make this happen you will need access to your control panel and theme files and the ability to upload to your theme file directory.

  • First, using a text editor (I use notepad) start your new template.
  • At the top of the new page place this code (without the brackets):

[<?php
 /*Template Name: Write New Template Name Here
*/
?>]

*When naming your new template be sure not to use any names that either your theme or WordPress already uses – you don’t want to overwrite anything .*

  • Now create your layout. This can be accomplished by copying and modifying the theme’s default page template or starting from scratch – it’s really up to you.  The page template can use template tags, html etc – again it’s up to you and the kind of page your are creating.
  • Once you have completed the template name the file and save as: new template name here.php.
  • Finally, upload your new template file into your active theme folder and you now have a new page template option.
  • To use your new template add a new page or edit an existing one – you will now find a dropdown menu option in the far right column that includes the default page template and your new template – choose which template to apply to the page and save.

Comment Pages

There are 2 Comments to "WordPress Custom Page Templates"