Page Template Help – Single Page Content
-
I’m attempting to create a “static” page template that will display only the content of the Page usting the template at any one time. I’d like the template to be utilized throughout my site and I expect to have MANY of these pages and sub-pages.
I’ve searched for something other than the loop to display Page content in the template (code below) to no avail. I understand that the content is displayed the same way a post content is displayed. I just need it to be limited to the page the template is currently being applied to. Make sense? Help?
Thanks,
-Mel—————— Template Page Code Below ——————
<?php
/*
Template Name: StaticPage
*/
?>
<?php get_header();?>
<div id=”main”>
<div id=”content”>
<?php if (have_posts()) : while (have_posts()) : the_post();?>
<div class=”post”>
<h2 id=”post-<?php the_ID(); ?>”><?php the_title();?></h2>
<div class=”entrytext”>
<?php the_content(‘<p class=”serif”>Read the rest of this page »</p>’); ?>
</div>
</div>
<?php endwhile; endif; ?>
</div>
<?php get_sidebar();?>
<?php get_footer();?>
</div>
- The topic ‘Page Template Help – Single Page Content’ is closed to new replies.