We were asked this question over the email, how to display the most commented posts in WordPress sidebar. Therefore, in this article we are sharing a plugin called Most Commented which displays a list of most commented posts in your sidebar.
You must download and activate the plugin. Then you need to place the following code in your sidebar.php or any other theme file.
<?php mdv_most_commented(); ?>
To customize the list, you may also use parameters like:
<?php mdv_most_commented(10, '', '<br />', true, 30, true) ?>
Parameters
$no_posts – sets the number of posts to display
$before – text to be displayed before the link to the post
$after – text to be displayed after the link to the post
$show_pass_post – whether or not to display password protected posts
$duration – displays comments for recent number of days
$echo – whether or not to echo the output or return an array of values
Above is the most popular plugin. An alternative plugin is called Most Comments which also provides a widget in the admin panel for you to use it. It basically gives you the same output.
How to Display Most Commented Posts in Your WordPress Sidebar
We were asked this question over the email, how to display the most commented posts in WordPress sidebar. Therefore, in this article we are sharing a plugin called Most Commented which displays a list of most commented posts in your sidebar.
You must download and activate the plugin. Then you need to place the following code in your sidebar.php or any other theme file.
To customize the list, you may also use parameters like:
Parameters
$no_posts – sets the number of posts to display
$before – text to be displayed before the link to the post
$after – text to be displayed after the link to the post
$show_pass_post – whether or not to display password protected posts
$duration – displays comments for recent number of days
$echo – whether or not to echo the output or return an array of values
Above is the most popular plugin. An alternative plugin is called Most Comments which also provides a widget in the admin panel for you to use it. It basically gives you the same output.
Most Commented
About Editorial Staff
Editorial Staff at WPBeginner mainly Syed and David.
What's Next
Get WPBeginner Articles in your Inbox:
Related Posts
Thank you!
This is really helpful and easy!
- spam
- offensive
- disagree
- off topic
Like