I can only give you an example of what i did to create my own php page template. I’m on WordPress 2.7 and the theme i am using is Zindi.
I wanted a page listing all the other pages I created and posted on my site. So…I opened up Notepad and pasted these contents in there:
<?php
/*
Template Name: Writings
*/
?>
<?php get_header(); ?>
<div id=”side-left”>
<div id=”content”>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class=”kutu”>
<div class=”ust”><span></span></div>
<div class=”post” id=”post-<?php the_ID(); ?>”>
<h2 class=”pagetitle”><?php the_title(); ?></h2>
After having a blog for a few years, I’ve had over 300 blog entries. Some of those entries effected my readers deeply. Here are those entries and a small collective of
some of my best work.
<div class=”entrytext”>
<?php
if($post->post_parent)
$children = wp_list_pages(“title_li=&child_of=”.$post->post_parent.”&echo=0″);
else
$children = wp_list_pages(“title_li=&child_of=”.$post->ID.”&echo=0″);
if ($children) { ?>
<?php } ?>
</div>
</div>
<?php endwhile; endif; ?>
<?php edit_post_link(‘Edit this entry.’, ‘<p style=”margin:10px;”>’, ‘</p>’); ?>
<br class=”clear” />
<div class=”alt”><span></span></div></div>
</div>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
I saved it as “writings.php” and uploaded it to my theme folder. I am using a theme called Zindi so the file path was /wp-content/themes/zindi which is where I can find all of my other page templates. I then went into “Appearance > Themes > Editor” just make sure it’s there. I clicked on “writings.php” to verify the coding is intact. When you do this, you will not see:
<?php
/*
Template Name: Writings
*/
?>
So I then went to Page > Add New. I didn’t type anything in the textarea. All I did was select the Writings template (towards the right there should be a dropdown called Template) and hit save.
Here’s the url to my results: https://chanellie.com/?page_id=8