Display more posts for categories than on index.php
-
Basically, I need the home page to display only 2 posts at a time, but would like 10-15 on all archive and search pages (these are only displaying titles and meta data)
At the moment I’m using the following at the start of the loop to limit the number of posts in index.php to 2:
<?php static $count = 0; if ($count == "2") { break; } else { ?>
(this code came from Perishable Press: https://perishablepress.com/press/2007/08/06/super-loop-exclude-specific-categories-and-display-any-number-of-posts/)
and setting the number of posts on the Reading Settings page to 15.This works perfectly with one exception. The next/previous posts links jump by 15, instead of 2.
I understand why this is happening, and should have seen it coming, I’m just not sure what the workaround is.
Thanks in advance!
- The topic ‘Display more posts for categories than on index.php’ is closed to new replies.