- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
WordPress. How to display the most recent comment on top
August 29, 2016
This video tutorial shows how to display the most recent comment on top in WordPress templates.
-
Login to WordPress admin panel, navigate to Settings and click on Discussions.
-
Under the Other comment settings you will find the option ‘Comments should be displayed with the older comments at the top of each page’. Click on the drop down menu and select Newer.
-
After that, you need to click on the Save Changes button at the bottom of the page, to save your settings.
-
Navigate to Appearance, click on Editor and open custom-function.php file for editing.
-
Simply add following code to the bottom of custom-function.php file:
function wpb_reverse_comments($comments) { return array_reverse($comments); } add_filter ('comments_array', 'wpb_reverse_comments');
When you are done, press the Update File button.
Alternative Method
Feel free to check the detailed video tutorial below:
WordPress. How to display the most recent comment on top