WordPress.org

Ready to get started?Download WordPress

Forums

Loop not displaying posts. (2 posts)

  1. low_stress
    Member
    Posted 6 years ago #

    Hi I am trying to write a loop that will display all the print and media 'press' clipping that have been recieved.

    So, I am just want to loop two categories(print and media) on a page devoted to that content.

    I am using a the default loop but it is not displaying *any* posts. What am I missing?

    <?php
    /*
    Template Name: Press Loop
    */
    ?>
    <?php get_header(); ?>
    <div id="content">
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <h1>" rel="bookmark"><?php the_title(); ?></h1>
    Posted on <?php the_time('F j, Y'); ?>

    <?php the_content(__('Read more'));?>
    <div id="meta">
    Filed Under <?php the_category(', ') ?> | <?php comments_popup_link('Leave a Comment', '1 Comment', '% Comments'); ?>

    </div>

    <!-- <?php trackback_rdf(); ?> -->

    <?php comments_template(); // Get wp-comments.php template ?>
    <?php endwhile; else: ?><?php endif; ?>
    <div class="navigation">
    <div class="alignleft"><?php posts_nav_link('','','« Previous Entries') ?></div>
    <div class="alignright"><?php posts_nav_link('','Next Entries »','') ?></div>
    </div>
    </div>

    <!-- The main column ends -->
    <?php get_footer(); ?>

    Any help would be kindly appreciated.

    Alex

  2. MichaelH
    Member
    Posted 6 years ago #

    Put something like this before your if have(posts) logic:

    query_posts('cat=2,6,17,38')

    Related:
    Template_Tags/query_posts

Topic Closed

This topic has been closed to new replies.

About this Topic