Use Wordpress Custom Page Template to Quickly Create Killer Landing Pages

by admin on December 9, 2009

Wordpress custom page template is not very well known, yet powerful Wordpress feature. It allows you to integrate any web page into your site with no problems.

You can basically make any Wordpress page look exactly as you want.

This is especially useful when you want to create landing pages, or squeeze pages, which typically have different design and layout as the rest of the Wordpress pages.

In order to save time changing your Wordpress theme and possibly damaging the current site design, just use the custom page template, and that’s it!

You can do it in 5 easy steps:

  • Open your .html file (the new web page) in the editor
  • Add template header to the HTML page.
  • Save the file as .php file
  • Upload the file to the folder of your current WordPress theme (e.g. “<website root>/wp-content/themes/default/”)
  • And now you can create a new empty page using our new page template.

Let’s review those steps in more detail.

1. Edit HTML file
You can take any HTML web page and make that page an integral part of your Wordpress website. When you’re using CSS style sheet or pictures, make sure you set the path to those items correctly. E.g. if you have an image main.gif in the images/ directory, your full path will be “<?php bloginfo(‘template_url’); ?>/images/main.gif”.

2. Add the header
Add this code piece to the beginning of the HTML page:

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

When adding the page template header code, use the meaningful template name after “Template Name:”, e.g. “Squeeze page template”. Make sure you do not use the names of the existing templates like “Default”, “Archives”, and “Links”…

3. Save
Your page could be names something like “squeezepage.php” or “landingpage.php”. Do not use names like page.php or archive.php – those files usually exist there already.

4. Upload
Find your default theme directory and upload the php file and all other files to the theme directory. E.g. for the default Wordpress theme, the directory is “<website root>/wp-content/themes/default/”. When you change the Wordpress theme, the page template will not be available there. You have to copy the page template to every theme you want to use.

5. Create a new page
Select the template from the list of templates when creating a new page (the Template combo box in the “Attributes” section on the right). The title of the page and the texts are irrelevant – they will not be used. Just make sure the permalink is created correctly. It usually makes sense to set the page as private, so it will not appear in the main blog menu. However, it depends on your intentions. If you want the template page appear as the home page, it must be public.

Note, that we have now created a template page which doesn’t use any content from the Wordpress. However, it is possible to create a template page which uses parts of the Wordpress theme, e.g. header, footer, etc. This will be part of the next article.

If you want to use the landing page template immediately, download our ready-to-use landing page template here http://www.websitesforsmes/websites-for-small-businesses.html . When you opt-in, the part of the download is a landing page template for you to use.

And here is the example of the landing page in action http://www.websitesforsmes.com/websites-for-small-businesses.html.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • NewsVine
  • Reddit
  • StumbleUpon
  • Google Bookmarks
  • Yahoo! Buzz
  • Twitter
  • Technorati
  • Live
  • LinkedIn
  • MySpace

Previous post:

Next post: