Support » Fixing WordPress » Different number of posts on different pages

  • Resolved TonyGeer


    Hi I tried searching the archives and came up with some similar stuff which wasn’t exactly what I’m looking for. What I want is this: on my main page (of the site), I want the one or two most recent posts. On another page, which will probably be the main blog page (index.php) I’d like a larger number.

    I know for the second page I can configure this in wordpress. The first page is the problem.

    Can anyone help? Using the latest version of WordPress as of now. Thanks for reading.

Viewing 13 replies - 1 through 13 (of 13 total)
  • What I want is this: on my main page (of the site), I want the one or two most recent posts.

    What is that main file/page? Created with WP? And if that is the main – I guess it has to be some kind of index… so how will you call the blogindex “index.php”, too?
    Is WP installed in a subfolder or in the root?
    The more info you give the easier for somebody to answer.

    Sorry I didnt supply enough information for anyone to help me. This is the complete scenario:

    Word press installed on the root of the site. The default for this will remain index.php. I only want the two most recent posts showing up (I know I can do this in wordpress).

    On another section of the site, it could be a wordpress Page, I want the top 20 (or any other variable number I can configure).

    I realise that the Archives page could be used for this, but that page only lists the categories and the by month posts.

    So bascially what I’m looking for is a way to have the archives page list X most recent posts.

    1. admin > Options > Reading: Show at most…
    2. “top” or “most recent” X number of posts? (it’s not the same…)

    Using the Template_Tags/wp_get_archives with the proper parameter might do what you want.

    Hi moshu, thanks for the replies so far. I’d like the 20 most recent post to show on the archives page. I’d like to have the posts showing just as they normally would on the main page, not just the title or anything like that.

    I’ve checked the template tags but I dont think it’s possible using them.

    Anyone know how this can be done?

    OK, then forget the Page, just use the normal archive.php template (actually WP “knows” how to use it, you don’t have to do anything) and use a plugin that will let you to have different number of posts on different views:

    EDITED* Just use the one moshu said above… =)


    But the one I linked to has a nice admin interface 😉

    Re-Edited* Oh ok, just went to the project page now, it is..awesome!! Downloading it now!!

    But the one I linked to has a nice admin interface 😉

    Haha..sorry bout that moshu, I’ll have to check that one out myself then lol! =) Thanks for it, I’ll bookmark it now.. 🙂


    I consider Matt Read’s plugin (i.e. moshu’s link above) to have long ago superceded Custom Posts Per Page. It does everything CPPP (hmm) can, and much more.

    Thanks for the linkage guys. I’m using the default archives.php from the Kubrick theme as the template for my Archives page.

    How I did this was to create a new WordPress Page, as set it to use the Archives template. It has archives by month and archives by category in it.

    However I’ve set conditions for is_archive, is_month and is_category and none of them are working. Im using the newest version of wordpress.

    Is it because I’ve created a page from the archives template and not used the archives.php directly that it’s not working?

    Thanks for your help so far.

    Note the difference between moshu’s reference of archive.php (which is for displaying date-related archive queries), and your mention of archives.php (which is a Page template).

    If you need to set up a Page to display post archives, I’d suggest looking at the info on query_posts():

    You are not reading carefully – but you are not the first one 😉
    There are 2 template files in your theme with very similar names:

    Notice the plural S at the end of the second one. That’s a Page template.
    The other is used by WP to display your monthly and category archives when clicking on a month name or cat name.
    See the difference on my dev. blog:
    monthly archive (WP automatically uses the archive.php)
    Archives Page (created using the archives.php Page template)

    BTW, never link directly to any of the template files!

    Man, I didnt realise that it was for archiveS.php. Either way, that plugin has proven to be immensly useful for me too. I would have eventually gone looking for something to do that exact thing.

    Kafk, thank you for the link! That’s exactly what I was looking for. I used


    Then ran the loop and it was exactly what I needed.

    Thanks a lot for the help everyone, it was highly appreciated! Im always impressed with the wordpress community.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Different number of posts on different pages’ is closed to new replies.