Ready to get started?Download WordPress


Recent posts by category: how to list more than 10 (4 posts)

  1. wordmunger
    Posted 9 years ago #


    I've figured out how to post a list of recent posts by category, but I'd like to list more than just ten (actually I want to list ALL of them). Any suggestions?

    Here's the relevant code:
    <li id="categories"><?php _e('Contents'); ?>
    <?php $temp_query = $wp_query; ?>
    <?php query_posts('category_name=chapterstart&order=ASC'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <h5 id="post-<?php the_ID(); ?>">
    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
    <?php the_title(); ?></a></h5>
    <?php endwhile; ?>
    <?php $wp_query = $temp_query; ?>

    A visit to the site will probably give a good indication of why I need to do this:

    Moby Blook

  2. Kafkaesqui

    Posted 9 years ago #

    Add &showposts=-1 to your query_posts parameter query string:


  3. wordmunger
    Posted 9 years ago #

    Woohoo! Thanks! Worked great!

  4. truenorth
    Posted 8 years ago #

    wordmunger -

    you maynot know it but you helped me tremendously, I've been searching every where to do what you just posted. Thanks!!

Topic Closed

This topic has been closed to new replies.

About this Topic