How can put the last post in the plugin Forums at the top of a topic ?

Hello,
I have just activate Forums on my site and I am very glad about that.
I would like to have the last post on top and not down at the end : how can I change the order and put the last post on top of a topic ?
Thanks for your answer, Hélène Scherrer

  • Patrick

    Hi there @Helene

    Welcome to WPMU DEV, glad to have you aboard!

    You can indeed reverse the order of the posts in topics. But that would also put the first post, the actual topic itself, at the very bottom.

    If that is what you want, you'll need to edit the forums.php file in the plugin. Scroll down to line 1436 where you'll see this:
    $query = $query . " ORDER BY post_ID ASC";

    Change that line to this:
    $query = $query . " ORDER BY post_ID DESC";

    Save and upload that edited file to your server via FTP to overwrite the original. Posts in your forum topics will then display in reverse order.

    Note that as this is an edit to a plugin file, you will need to re-do the same edit every time you update the plugin.

    I hope this helps! And thanks for being a member :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.