WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] WP1.52: Comments -can I change from descending to ascending?

[Resolved] WP1.52: Comments -can I change from descending to ascending?

  • Hi there,

    I wondered if I can change the way comment view. At present the oldest comment is at the top and newsest at the bottom. How do I reverse that? Can I reverse that?

    Thanks
    Karl

Viewing 5 replies - 1 through 5 (of 5 total)
  • /wp-includes/comment-functions.php

    Right near the top is this line:
    $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND comment_approved = '1' ORDER BY comment_date DESC");

    only when you see it, the DESC at the end isn’t there. Add it.

    then look a few lines further down and you’ll see pretty much the same line. Again, add DESC at the end.
    That should flip your comments over 🙂

    Note: This is a core file so make a note of this so you can replicate the change if you upgrade.

    Thanks 😉

    TechGnome

    @techgnome

    Moderator

    If this is now resolved, could you please mark the thread as resolved? There’s a link at the top, just above the thread (below the title) to do this.

    -tg

    Hmm…. I just tried this and I get:

    Parse error: syntax error, unexpected $end in /home/…../wp-includes/comment-functions.php on line 730

    I tried and made sure I did it right.

    I got it to work. When I had used the cpanel editor to make the change it didn’t like it, but when I edited it offline and uploaded it, it was fine. Weird.

    Anyway, one other thing though. I sure would be nice to have the numbering on the comments change too.

    Seems like a lot of people want this, enough to make it an option in WP. Or a plugin at least.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] WP1.52: Comments -can I change from descending to ascending?’ is closed to new replies.
Skip to toolbar