Carrington theme – display comments in reverse order

January 15, 2009 - Views: 5276
Category: Web Development

Unfortunately, the favorite wordpress theme carrington-blog displays the comments in a reverse order. By default, the newes comment is shown at bottom. If you want to display the newest comment on top of list, you have to follow these instructions:

Open the file themes/carrington-blog/comments/comments-default.php


if ($comments) {
// add this command to reorder the comments
$comments = array_reverse($comments);
$comment_count = 0;

  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • MisterWong
  • Yigg
  • Technorati
  • Blogosphere News
  • LinkArena
  • Webnews.de

Tags: , ,

Related Posts:

4 Responses

  1. I’ve just tried it with 2.2. It also works. Are you sure you made the correct changes?

  2. Andrea Casalotti

    October 18th, 2009

    Cannot get it to work in version 2.2. Am I doing something wrong?

  3. To keep the select menu working in the admin panel you can change the line above to the following.

    if ($comments) {
    // add this command to reorder the comments
    if(get_option(‘comment_order’) === ‘desc’){
    $comments = array_reverse($comments);
    }
    $comment_count = 0;

    This way you can still switch between how you want them ordered without it being hard coded.

    Thanks for the help Michael, this really helped.

  4. Probably, you can use this also in different wordpress themes.

Leave a Reply

Home | Imprint | Impressum | Archiv
© 2009 M.Sc. Dipl.Inf. Michael Kolb. Powered by Wordpress. HTML CSS
my technorati | my blogcatalog