When we wrote about how to 显示 WordPress 中评论最多的帖子, we highlighted a plugin to make beginner’s life easier. However some of our users asked us if there was a way to display most commented posts without installing a plugin. In this article, we will share a code snippet that you can add to display most commented posts in WordPress without a plugin.
Please note, that this method is not suitable for beginners. If you do not feel confident about adding code, then you should checkout our guide on how to display WordPress 中评论最多的帖子 by using a plugin. If you are looking for a way to display your most popular content, then checkout our list of the best WordPress 的热门帖子插件.
The last line enables shortcode execution in text widgets. Now in order to show the results, all you need to do is add [wpb_most_commented] shortcode in a text widget, or in any WordPress post or page.