WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. wordmunger
    Member
    Posted 9 years ago #

    Hi--

    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'); ?>
    <ul>
    <?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:

    query_posts('category_name=chapterstart&order=ASC&showposts=-1')

  3. wordmunger
    Member
    Posted 9 years ago #

    Woohoo! Thanks! Worked great!

  4. truenorth
    Member
    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

Tags