Forums

How Can I Show New Comments First? (8 posts)

  1. pclove
    Member
    Posted 3 years ago #

    Right now, my blog shows comments with oldest first, and I want it to show latest first. How do I change this?

    Thanks.

  2. pclove
    Member
    Posted 3 years ago #

    Well, I found the answer through a few different Google searches using different search terms.

    The solution is here:
    http://gerropost.net/2008/09/how-to-comments-order-wordpress/

    Hope this helps someone else.

  3. demonboy
    Member
    Posted 3 years ago #

    Not quite because the link to the article has changed.

    Here is the latest link

  4. Shane G
    Member
    Posted 3 years ago #

    Hi,

    You can use recent comments widget tool to display recent comments first.

    [signature moderated Please read the Forum Rules]

  5. ednlam
    Member
    Posted 3 years ago #

    Hi Demonboy,

    I have been posting the same question in this forum and still haven't received any fixed to display the newer comments at the top of the page. I had set the dropdown listing to "newer" at the admin/setting/discussion, and it doesn't work at all!

    I have been to the "latest Link" you provided and it mentioned: "The trick is to reverse ....." - the line disappeared from there and I am not able to figure out the instruction. Do you think you can provide me the complete instruction here. This is most appreciated as I have been anxious to fix this for quite a long time.

    Plse help.

    Edmund

  6. ednlam
    Member
    Posted 3 years ago #

    Hi Demonbuy,

    I got it fixed. The comments are displaying the way I wanted it. Thanks for the code.

    ED

  7. demonboy
    Member
    Posted 3 years ago #

    No problem, though I will repeat the instructions here just so other people searching for it can understand what's going on.

    It really is VERY simple!

    1. Open comments.php
    2. Find the line: foreach ($comments as $comment) {
    3. Immediately before that line, add $comments = array_reverse($comments);

    That's it!

  8. iconico
    Member
    Posted 2 years ago #

    thanks demonboy!

    what i did, and it works fine, i simply replaced
    <?php foreach ($comments as $comment) : ?>

    with
    <?php foreach (array_reverse($comments) as $comment) : ?>

    now the newest comments are on the top!

Topic Closed

This topic has been closed to new replies.

About this Topic