Viewing 8 replies - 1 through 8 (of 8 total)
  • I’ve searched the sama answer for many hours.

    My theme (simplicity) has a comments.php with this line:

    $comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = '$id' AND comment_approved = '1' ORDER BY comment_date");`

    Can I add asc_order or something?

    following this tip find comments.php in your theme and

    replace this:
    <?php foreach ($comments as $comment) : ?>

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

    then whatever order you have will be reversed.

    Thanks! That fixed it. Next I will try to move the comments form as well:)

    where do you put this code??

    Thanks in advance

    Caveat: The comments will be in reverse order, but the last (top) comment will be numbered as “1.”. One solution is to set the list-style-type to “none” so that there just aren’t numbers at all. I’d prefer to show the highest number instead, but have no idea if this is possible, or how to do it if it is.

    deuced, just what I was looking for.
    Thanks!!!

    I wanted my comments to display newest-first, with reverse numbering: 10, 9, 8, etc. My workaround for this was to change the ol for the comments to an ul, and then add a counter that decrements with each trip around the loop that generates the comments. Not sure that’s the most elegant way to do it, but it worked.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Comments in reverse order’ is closed to new replies.