WP Help

Out of context: Reply #4

  • Started
  • Last post
  • 13 Responses
  • jar0

    i don't see why it shouldn't work. this is how i've done it for most sites.

    <?php $newsPosts = new WP_Query();
    $newsPosts->query('showposts=5&cat=6');
    ?>

    <?php while ($newsPosts->have_posts()) : $newsPosts->the_post(); ?>

    <h2>
    <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
    </h2>

    <?php endwhile; ?>

View thread