When we talk about the wordpress templates its to customize the look of wordpress themes , if we want to make the page looks different from the regular pages then we assign a page templates for a particular page .page templates are needed to give professional look of the web site and , page templates allow easy customization of pages and a look totally on our wish .its good way to make custom pages.well templates is good way to make professional look.. lets learn here how to make it
to make a template we need to assign a name of the templates as that wordpress recognize it
<?php
/*
Template Name:forum
*/
<div id=”casing”>
get_header();
if(have_posts())while(have_posts()){the_post();the_content();}
</div>
get_footer();
?>

this is simple page template named forum.php
if we want to make page template from the default page template then open –> page.php file of wordpress theme
put the template name on the top of the code after php tag
<?php
/*
Template Name:forum
*/
rest of the code………
?>
now save it as as the name of the template here use forum.php
Now giving example of existing code page.php
<?php get_header(); ?>
<div id=”foxmenucontainer”>
<div id=”menu”>
<ul>
<?php wp_list_categories(’sort_column=name&title_li=&depth=4′); ?>
</ul>
</div>
</div>
<div id=”casing”>
<div id=”content”>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div id=”post-<?php the_ID(); ?>”>
<div>
<h2><a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></a></h2>
</div>
<div>
<div>
<?php the_content(‘Read the rest of this entry »’); ?>
<div></div>
<?php wp_link_pages(array(‘before’ => ‘<p><strong>Pages: </strong> ‘, ‘after’ => ‘</p>’, ‘next_or_number’ => ‘number’)); ?>
</div>
</div>
</div>
<?php endwhile; endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
now we make it as page templates test.php by editing code and removing the code that we not want on the to see in the page .
<?php
/*
Template Name:test
*/
get_header(); ?>
<div id=”foxmenucontainer”>
<div id=”menu”>
<ul>
<?php wp_list_categories(’sort_column=name&title_li=&depth=4′); ?>
</ul>
</div>
</div>
<div id=”casing”>
<div id=”content1″>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div>
<h2><a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></a></h2>
</div>
<div>
<div>
<?php the_content(‘Read the rest of this entry »’); ?>
<div></div>
<?php wp_link_pages(array(‘before’ => ‘<p><strong>Pages: </strong> ‘, ‘after’ => ‘</p>’, ‘next_or_number’ => ‘number’)); ?>
</div>
</div>
<?php endwhile; endif; ?>
</div>
<?php get_footer(); ?>
upload in the theme directory and assign the page template for any page we wish .
<?php
/*
Template Name:forum
*/
<div id=”casing”>
get_header();
if(have_posts())while(have_posts()){the_post();the_content();}
</div>
get_footer();
?>

this is simple page template named forum.php
if we want to make page template from the default page template then open –> page.php file of wordpress theme
put the template name on the top of the code after php tag
<?php
/*
Template Name:forum
*/
rest of the code………
?>
now save it as as the name of the template here use forum.php
Now giving example of existing code page.php
<?php get_header(); ?>
<div id=”foxmenucontainer”>
<div id=”menu”>
<ul>
<?php wp_list_categories(’sort_column=name&title_li=&depth=4′); ?>
</ul>
</div>
</div>
<div id=”casing”>
<div id=”content”>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div id=”post-<?php the_ID(); ?>”>
<div>
<h2><a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></a></h2>
</div>
<div>
<div>
<?php the_content(‘Read the rest of this entry »’); ?>
<div></div>
<?php wp_link_pages(array(‘before’ => ‘<p><strong>Pages: </strong> ‘, ‘after’ => ‘</p>’, ‘next_or_number’ => ‘number’)); ?>
</div>
</div>
</div>
<?php endwhile; endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
now we make it as page templates test.php by editing code and removing the code that we not want on the to see in the page .
<?php
/*
Template Name:test
*/
get_header(); ?>
<div id=”foxmenucontainer”>
<div id=”menu”>
<ul>
<?php wp_list_categories(’sort_column=name&title_li=&depth=4′); ?>
</ul>
</div>
</div>
<div id=”casing”>
<div id=”content1″>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div>
<h2><a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></a></h2>
</div>
<div>
<div>
<?php the_content(‘Read the rest of this entry »’); ?>
<div></div>
<?php wp_link_pages(array(‘before’ => ‘<p><strong>Pages: </strong> ‘, ‘after’ => ‘</p>’, ‘next_or_number’ => ‘number’)); ?>
</div>
</div>
<?php endwhile; endif; ?>
</div>
<?php get_footer(); ?>
upload in the theme directory and assign the page template for any page we wish .
Popularity: 19% [?]
