Page/Archive template that includes all recent posts?
-
I’ve created a template to include all recent posts and called it Full Blog.
Then, I went and made a Page and assigned the “Full Blog” template to it, and “blog” as its post-slug.
However, if I use The Loop in the “Full Blog” template, it simply displays the content of the Page (an empty post with a title, and that’s it) rather than all of the blog’s recent posts.
However, if I omit the loop and code it as it is below, it works (shows all posts) but the # of comments link doesn’t show up.
Can anyone give me any pointers?
<?php get_header(); ?>
<body>
<div id="container2">
<div id="header"><span></span></div><?php include (TEMPLATEPATH . "/navbar.php"); ?>
<div id="centerfill">
<h1><span>Insight Blog</span></h1><div id="blogcontentleft">
<?php $posts = get_posts('numberposts=12'); foreach($posts as $post) : setup_postdata($post); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php the_time('F jS, Y') ?> by <?php the_author() ?><div class="entry">
<?php the_content('Read the rest of this entry »'); ?>
</div><p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
</div>
<?php endforeach; ?>
</div>
<div id="blogcontentright"><?php get_sidebar(); ?>
</div>
</div>
<br class="clear">
</div><?php get_footer(); ?>
- The topic ‘Page/Archive template that includes all recent posts?’ is closed to new replies.