Limit number of posts on page 1 in archives
-
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?
- The topic ‘Limit number of posts on page 1 in archives’ is closed to new replies.