Support » Fixing WordPress » Category pages override "Blog pages show at most". Possible?

  • 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 ) );

    Thread Starter intellivision

    (@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.