WordPress Comments - Listing in Reverse Chronological Order

The default WordPress Theme template for listing comments and pingbacks displays comments from oldest to newest. To list the WordPress Post comments in reverse chronological order, you can make this simple change in your comments.php template file.
Locate a line which looks like the following:

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

and wrap around the $comments variable, array_reverse():

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

Find more WordPress Tips.

One Response to “WordPress Comments - Listing in Reverse Chronological Order”

  1. Leon Kilat ::: The Cybercafe Experiments » Reverse the order of your WordPress comments Says:

    […] WordPress, by default, lists comments in chronological order. If you want to reverse the listing and publish the latest comments first, edit your template following the tips here. Technorati Tags: blogging wordpress Related posts in Leon Kilat: The Cybercafe Experiments Installing Akismet to deal with comment spamJournalists who don’t yet ‘get’ blogsBecause it’s there and it’s so darned prettyCourt orders PCIJ to remove blog postUpgrading WordpressChanging the chat boxSign up for a better blog tracker with Measure MapWordPress 1.5.2 released by Max | posted in Asides Trackback URL | Comment RSS Feed Tag at del.icio.us | Incoming links […]

Leave a Reply

You must be logged in to post a comment.