Different posts per page on different categories
-
Hi,
I want to show different number of posts per page depending on which category I am viewing.
I did try this:
<?php if(is_category('4')) { query_posts('posts_per_page=2'); } else if(is_category('1')) { query_posts('posts_per_page=3'); } else if(is_category('5')) { query_posts('posts_per_page=100'); } else if(is_category('6')) { query_posts('posts_per_page=100'); } else if(is_category('7')) { query_posts('posts_per_page=100'); } ?>
I put that code in category.php before:
<?php if (have_posts()) : ?>
This results in showing the correct number of posts, but from all categories.
Am I doing something wrong?
Viewing 13 replies - 1 through 13 (of 13 total)
Viewing 13 replies - 1 through 13 (of 13 total)
- The topic ‘Different posts per page on different categories’ is closed to new replies.