Forums

[resolved] Showing multiple posts on Archive page (7 posts)

  1. 157GS
    Member
    Posted 4 years ago #

    I've been searching here at the forums, the documentation and the internet in general and I can't believe I haven't found a solution for this yet.

    I am trying to get my Archive.php page to display a montly archive of 50 entries at a time. Right now (I'm working locally so I can't link to it right now) it just shows a single entry and a user must paginate back via "previous entries" to view other posts from that month.

    If I place this code it does show 50 posts at a time:
    <?php $posts = query_posts('showposts=50');?>
    but if have more than 50 posts - when I paginate via "previous entries" to another page, it just shows the same exact same 50 entries instead of more from the archive.

    Is there any way to do this? Thanks for any help.

  2. jonimueller
    Member
    Posted 4 years ago #

    Are you wanting to display a list of 50 at a time, like this:

    title of a post
    title of another post

    etc.

    I assume you aren't displaying the entire post but a link, correct? I think there is a plugin that paginates but I'm not sure how far it goes. Let me try to find it for you.

  3. 157GS
    Member
    Posted 4 years ago #

    I assume you aren't displaying the entire post but a link, correct?

    Yes, that's correct. I've actually customized what it's returning on the query. It does return the title, date, and a summary of the post.

    But it's not about the actual single post, I'm just trying to dump at least 50 posts onto a single page at a time. I will certainly look at a plugin, though I thought I would rather get in over my head and try to hack it myself. =)

    Cheers.

  4. jonimueller
    Member
    Posted 4 years ago #

    This one paginates posts but don't know if that applies to archives or not:
    http://anthologyoi.com/awp

    Don't know about this one, it doesn't mention pagination, but either of these might have some useful code in them if you are of a mind to "roll your own". :-P
    http://www.learncpp.com/wordpress/category_archive_indexing_plugin/

  5. 157GS
    Member
    Posted 4 years ago #

    Hey jonimueller, thanks for those links. I'll check those out and post back here with a solution if I'm able to come up with one.....

    Thanks again.

  6. 157GS
    Member
    Posted 4 years ago #

    Those links didn't really work out but I did find this:
    http://www.transycan.net/blogtest/2007/10/30/custom-query-string-reloaded-for-wordpress-23-with-tag-support/

    This does what I want but is a bit bloated for what I want to do. It seems like overkill to just simply show multiple posts at once...

    anybody else have any ideas?

  7. 157GS
    Member
    Posted 4 years ago #

    aha! I think this one is resolved. I was headed down the correct path with:

    <?php $posts = query_posts('showposts=50');?>

    but apparently, that overrides the original query and that's why it was messing up pagination. (see this post: http://wordpress.org/support/topic/115740?replies=5)

    Once I added $query_string, it seemed to fix the pagination issue:

    <?php query_posts($query_string.'&showposts=2'); ?>

    hope this helps others looking to add multiple posts to specific pages.

Topic Closed

This topic has been closed to new replies.

About this Topic