WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] WP1.52: Comments -can I change from descending to ascending? (6 posts)

  1. elyonline
    Member
    Posted 8 years ago #

    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

  2. Mark (podz)
    Support Maven
    Posted 8 years ago #

    /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.

  3. elyonline
    Member
    Posted 8 years ago #

    Thanks ;)

  4. TechGnome
    Moderator
    Posted 8 years ago #

    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

  5. slobizman
    Member
    Posted 7 years ago #

    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.

  6. slobizman
    Member
    Posted 7 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags