WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Number of posts on category pages different from front page (3 posts)

  1. peanut
    Member
    Posted 8 years ago #

    I'm stuck. I'm running WordPress 1.5. I want 4 posts to show on front page (which is working), but I want 20 posts to show when someone clicks on any and every category (I have a special category.php page). I believe I need to do posts_per_page=20 somewhere on my category.php page and replace something, but not sure where and what...

    I tried using Matt's Custom Query String 2.6, but it would be inefficient for me as I would need to set it for each category (unless I missed something).

    The pertinent part of my category.php page looks like:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("paged=$paged&cat=$cat&orderby=title&order=ASC");
    ?>
    <?php if (is_category()) { $posts = query_posts($query_string . '&orderby=title&order=asc'); } ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    I know it's probably something very simple, but I think I've really confused myself in looking for answers. Guidance?

  2. Kafkaesqui

    Posted 8 years ago #

    "I tried using Matt's Custom Query String 2.6, but it would be inefficient for me as I would need to set it for each category (unless I missed something)."

    You did. You only need set is_category on Query to affect all categories.

  3. peanut
    Member
    Posted 8 years ago #

    Oy. Thank you so much! :)

Topic Closed

This topic has been closed to new replies.

About this Topic