Displaying all posts in a template

  • Unknown's avatar

    Hi there,

    I’ve managed to build my own theme, and have the index page working nicely. Now I’m trying to add other pages, starting with a latest news page. I’ve applied a new template to this page (as i want it to have a slightly different layout than index) and I’m trying to display all of the posts. I’ve had a stab at this, but am obviously doing something wrong.

    Here’s my current code:

    <?php
    /*
    Template Name: News
    */
    ?>

    <?php get_header(); ?>
    <?php get_sidebar(); ?>

    <div id='right-col'>
    <div id='top-content'></div>
    <div id='content'>
    <div id='left-content-col'>
    <?php if(have_posts()) : ?>
    <?php while(have_posts()) : the_post() ?>

    <div class='post_snippet'>
    <h3>" title="Permanent link to <?php the_title_attribute(); ?>"><?php the_title(); ?></h3>
    <?php the_content('Continue Reading...'); ?>
    </div>

    <?php endwhile; ?>
    <p><?php previous_posts_link('Previous Entries');?><?php next_posts_link('Older Entries');?></p>
    <?php else :?>
    <h3>Sorry but we could not find what you were looking for. But don't give up, keep at it!</h3>
    <?php endif; ?>
    <!--End Content--></div>
    </div><!--end content-->

    <div id='btm-content'></div>
    </div><!--end right-col-->
    </div><!--end container-->

    <?php get_footer(); ?>

    The header, sidebar and footer are all fine. But my posts won’t display.

    Any ideas where I’m going wrong?

    Thanks

  • Unknown's avatar

    You did not specify a blog address or reason for posting when you created this topic.

    This support forum is for WordPress.com hosted blogs only. If you have a self-hosted WordPress blog you need to seek help at the WordPress.org forums, not here.

    If you don’t understand the difference, you may find this information helpful.

  • The topic ‘Displaying all posts in a template’ is closed to new replies.