• Chad

    (@lynneandchad)


    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!

Viewing 16 replies (of 16 total)
  • Experiencing the same issue when adding a loop (with an explicit pages_per_post value that is less than the site setting) to a page template to show recent posts in addition to the content of the home page.

    Works fine if I artificially restrict the post per page settings to match the query, but that means archive and category pages are very short.

    Lovely WP lameness

Viewing 16 replies (of 16 total)
  • The topic ‘Display more posts for categories than on index.php’ is closed to new replies.