• I’ve searched for about 45 minutes on these forums and on google… I cant seem to find any hack that works or any plugins that do this.

    I need to display a postbypost list for one category only. The get_archives and wp_get_archives dont have a var to select just one category. I tried query_posts but nothing shows up.. I’m guessing it has to be in the loop or something. I need it to show up in the sidebar.

    If anyone could help it would be great ??

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • get_archives() and wp_get_archive() are ignorant of categories, so you won’t be able to do this with them. I’d suggest:

    <ul>
    <?php $my_catposts = new WP_Query('cat=
    1&showposts=999'); ?>
    <?php while($my_catposts->have_posts()) : $my_catposts->the_post(); ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endwhile; ?>
    </ul>

    Change the cat value (1) to the appropriate numeric category ID. You can also change the showposts value (if it seems excessive!), and of course display this in some other fashion than an unordered list.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘postbypost for one category’ is closed to new replies.