Sunday, July 19, 2009

Page Template to give a variation in Wordpress Theme

Below is a brief Article of Page Template to give a variation in Wordpress Theme.

Variation wordpress page template is important thing we should do if we want different theme in a single wordpress site. This manner also important for reducing the needed of size by different wordpress theme (Usually we need 2 wordpress site if we want two different theme).

This only can be done in downloadable wordpress (not in wordpress.com), because we need to add few extra file that can be a page template of Wordpress Theme.

see the file structure below (usually in wordpress theme directory)

page.php
--> load header.php
load #header {in style.css file}
--> load sidebar.php
--> load footer.php

page1.php
--> load header1.php
load #header1 {in style.css file}
--> load sidebar1.php
--> load footer1.php
page2.php
--> load header2.php
load #header2 {in style.css file}
--> load sidebar2.php
--> load footer2.php

all the thing we should do are
1. create page1.php and page2.php and more page template that we need.
2. create definition that usually same as #header in style.css but load a different header image. example #header1

this definition load another header image, so the appearance will be different from default appearance.

3. Use this syntax usually before <?php get_header(); ?>

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

4. Choose a page template in creating new page. See The Example below..


Figure 1. Choose a Default Page template
Figure 1. Choose a Custom Page template.

5. The Result


Figure 3. Appearance with default Page Template

Figure 4. Appearance with Custom Page Template.

That's all, now you can have a variation appearance in one wordpress site. We can make many kind of page template, that can produce variation of appearance in our site.

0 comments:

Post a Comment

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Sweet Tomatoes Printable Coupons