Support » Fixing WordPress » Display posts on page in custom theme

  • I created a custom theme by turning regular HTML pages into page templates, pretty much. I thought this site was just going to be completely static, but then I was asked to implement a blog page.

    For the life of me, I can’t figure out how to get POSTS into one of these page templates. I copied the following code out of the codex, but all it does is diplay the PAGE title and edit button, rather than displaying a post:

    <?php if (have_posts()) : while (have_posts()) : the_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 &raquo;</p>'); ?>
      </div>
     <?php endwhile; endif; ?>
     <?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>

    I need to get at least the most recent post onto this page, and ideally the last three. I’ve scoured the site and can’t find anybody in my particular situation. Any ideas?

Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Display posts on page in custom theme’ is closed to new replies.