Whether your theme shows the newest comments at the top or the oldest, you might want to change how comments are ordered in WordPress. Having the latest comments on top can make people interact more with your stuff. No matter what order you like (or your visitors prefer), here are two easy ways to change the arrangement of comments in WordPress.
First, I’ll explain how to change the comment order using the option already in WordPress:
Using WordPress Comment Order Option
The simplest way to switch the order of comments in WordPress is to use the tool already built into WordPress. You can find this tool in the “Settings” section under “Discussion.” There, you’ll see a line that says, “comments should be displayed with the newer comments at the top of each page.” You can check or uncheck this based on how you want your comments to show up.
Keep in mind that this method might not work with all themes, because some themes might use their own special ways to show comments.
Change WordPress Comment Order using Functions.php Code Snippet
If you know your way around WordPress a bit better, you can use this special piece of code in your functions.php file or through the Code Snippets plugin to change the comment order:
<?php //Reverse comment order function da_reverse_comment_order( $comments ) { return array_reverse( $comments ); } add_filter ('comments_array', 'da_reverse_comment_order');
This piece of code will turn around the way your WordPress comments show up. This is useful if the regular WordPress option doesn’t work well with your theme.
If you’re not sure how to add code snippets to your site, you can watch a video that explains two ways to do it.
I hope this fast tip about WordPress helped you out! If you run into any problems, just tell me in the comments below.
Related Articles
Leave a Reply