WordPress.org

Ready to get started?Download WordPress

Forums

Pagination Override Question (4 posts)

  1. Joe Siegler
    Member
    Posted 4 years ago #

    I just tonight discovered the magic of an archive template with the name of category-7.php. I like that you can customize for specific categories.

    I did run into this though. For this one specific category, is it possible to override the number of posts displyed before pagination kicks in? It's set to 10 on my site, which for everything else is fine, but not this category. I'd like to make it much larger. Or better yet, display everything on one page.

    How can this be done just for a specific category? Thanks.

  2. alchymyth
    Forum Moderator
    Posted 4 years ago #

    in categeory-7.php, add:

    <?php global $query_string;
    query_posts($query_string . "&posts_per_page=-1"); ?>

    ( -1 for all, or enter the number you want)
    before the loop.

    read: http://codex.wordpress.org/Template_Tags/query_posts

  3. Joe Siegler
    Member
    Posted 4 years ago #

    I did look in the docs (Since I believe in RTFM before asking), but must have missed that page. Thank you.

  4. Joe Siegler
    Member
    Posted 4 years ago #

    I did that back when you suggested it a few days ago, and it worked (thanks for the code).

    However, my pagination at the bottom still is showing 19 pages from when it was at the default of 10 per page. There any way to tell the pagination "Hey, I don't really have that many pages anymore"?

Topic Closed

This topic has been closed to new replies.

About this Topic