• Hi,

    I’m building a site where I want to limit the number of posts on page one in each category. I’ve tried different approaches but nothing works as intended. I’ve spent hours and hours on google without any luck 🙁

    If I use query_posts, the get_the_category function breaks (which I need. It just returns the same value in every category), so thats no good. Plus, the pagenation is acting funny.

    The closest I got so far is to manually break the loop, like this

    <?php static $ctr = 0; if ($ctr++ == "5" && !is_paged() ) { break; } ?>

    But the problem here is that the next five posts are skipped on page two (my global limit is set to 10).

    So my question i basically how to limit posts on the first category page without something else breaking?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter twarkie

    (@twarkie)

    Sorry for bumping this, but I still haven’t found a solution for this problem yet :-/

    I’m looking at doing the same thing and have run into the same problems. There doesn’t seem to be a very clear way of doing it.

    I want 9 posts on the front page of index, and like 12 on every previous page.

    I’d like 16 on all archives pages, or maybe different numbers determined at runtime.

    There’s a plugin, search for “different posts per page” that does something kind of like this, but not quite.

    Mark

    (@encryptdesigns)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Limit number of posts on page 1 in archives’ is closed to new replies.