Support » Themes and Templates » Reverse Comment Order in twenty-ten?

  • sepp88

    (@sepp88)


    hey guys,
    I wonder how i can reverse the comment-order of a page-template in my current twenty-ten theme. i found a few solutions of various blogs to reverse the order with a simple php reverse(array) function. however, the twenty-ten theme works with

    comments_template('','true');

    any ideas how to do that?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    One way would be to make a separate comments template.

    comments_template('/comments-reverse.php', true );

    Then make a copy of comments.php into comments-reverse.php. In the comments-reverse.php file, find this line:
    wp_list_comments( array( 'callback' => 'twentyten_comment' ) );

    And change it to this:
    wp_list_comments( array( 'callback' => 'twentyten_comment', 'reverse_top_level' => true ) );

    Naturally, I’d recommend doing this in a child theme. The twenty-ten theme gets overwritten during upgrades.

    sepp88

    (@sepp88)

    awesome solution, thank you very much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Reverse Comment Order in twenty-ten?’ is closed to new replies.