WordPress.org

Ready to get started?Download WordPress

Forums

Reverse Comment Order in twenty-ten? (3 posts)

  1. sepp88
    Member
    Posted 3 years ago #

    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?

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 3 years ago #

    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.

  3. sepp88
    Member
    Posted 3 years ago #

    awesome solution, thank you very much!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.