Categories

Featured templates

WordPress. How to display the most recent comment on top

George Jones August 29, 2016
Rating: 5.0/5. From 2 votes.
Please wait...

This video tutorial shows how to display the most recent comment on top in WordPress templates.

  1. Login to WordPress admin panel, navigate to Settings and click on Discussions.

    WordPress_how_to_display_the_most_recent_comment_on_top-1
  2. 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.

    WordPress_how_to_display_the_most_recent_comment_on_top-2
  3. After that, you need to click on the Save Changes button at the bottom of the page, to save your settings.

    WordPress_how_to_display_the_most_recent_comment_on_top-3
  4. Alternative Method

  5. Navigate to Appearance, click on Editor and open custom-function.php file for editing.

    WordPress_how_to_display_the_most_recent_comment_on_top-4
  6. 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.

    WordPress_how_to_display_the_most_recent_comment_on_top-5

Feel free to check the detailed video tutorial below:

WordPress. How to display the most recent comment on top
Top Premium Wordpress Themes
This entry was posted in WordPress Tutorials and tagged comments, latest, WordPress. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket