• I’d like to set the number of posts on the index to something different than the default (i.e. what I set under Options > Reading).

    I’ve tried out both the code given here
    (<?php static $ctr = 0; if ($ctr == "X"))
    and here
    (if ($_SERVER[REQUEST_URI] == "/") { $posts = get_posts('numberposts=X');)
    but just keep getting error messages.

    Apparently I don’t know enough about PHP to implement those instructions (both lack <?php markers somewhere, I think?), so I would be very grateful if someone could post the exact code that is required to limit the number of entries.

    Thanks a lot!

Viewing 4 replies - 1 through 4 (of 4 total)
  • So you have set the number of posts to be viewed in your reading>options>show x posts – but you want to change from what it is to something else? Is it because you want different multiples?

    Thread Starter mumble

    (@mumble)

    I want only a small number of posts on the main page (maybe 5), but a larger number of excerpts (since that’s what I display otherwise) on category and search pages. I can control the latter through the options, and would now like to know how to limit the number for the index page. It’s possible, right?

    Whoops, I forgot. I’m using WP 1.5.

    Try this.

    Thread Starter mumble

    (@mumble)

    Yay, that did the trick. Usually I love trying out new plugins, but somehow I really wanted to mess with the file itself this time. Bad me. Thanks a lot!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Control the number of posts displayed on the main page?’ is closed to new replies.