WordPress.org

Support

Support » How-To and Troubleshooting » Category pages override "Blog pages show at most". Possible?

Category pages override "Blog pages show at most". Possible?

  • Matt

    @intellivision

    Going to a category page shows the same number of posts as the “Blog pages show at most” setting.

    How can I make them show n number of posts, or all posts in a category?

    thx
    I

Viewing 2 replies - 1 through 2 (of 2 total)
  • If you edit the category.php template file you can do a custom query to get back exactly the number of posts you want. You would put this code just before the loop.

    Get back 10 posts from current category
    query_posts( array ( 'category_name' => single_cat_title( '', false ), 'posts_per_page' => 10 ) );

    Get back all posts from current category
    query_posts( array ( 'category_name' => single_cat_title( '', false ), 'posts_per_page' => -1 ) );

    Matt

    @intellivision

    Thank you, J. Problem is, I’m using Twenty Ten theme with a loop-category.php driving category.php. I’ve tried putting your code here and there and it hasn’t worked.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Category pages override "Blog pages show at most". Possible?’ is closed to new replies.
Skip to toolbar