Even though most of the WordPress themes use a unique page template, our favorite blogging engine allows us to create as many different page templates as we want.
Why always use the same page layout in your blog? Using different page templates will make your blog look a lot more professional.
In this recipe, you'll learn to create and use page templates.
To achieve this recipe, you only need a WordPress theme and a text editor. In the following example, we use the WordPress default theme. If you're using another theme, you'll have to adjust the code a bit to make it fit your theme HTML markup.
Let us start with creating a test page template and learn how to create more page templates in the following recipes.
On your theme directory, create a new file and name it
testpage.php
.Open the
testpage.php
file in your favorite text editor and insert the following code in it:<?php /* Template Name: Test Page */ ?> <?php get_header...