Revised Most Commented Post Plugin

Awhile back, I created a plugin that would allow you to put a template tag on your site to display popular posts based on the number of comments on posts. It was quick, dirty and not the best code I have ever written. I have completely rebuilt it using the WordPress Widget system so you can add it to your sidebar via the Widgets Administration panel. This widget works based on the number of comments on your posts. It takes the most commented post and gives it a value of 1. You can then pick up to three levels to compare the other number of comments per post. You can also pick the number of posts to display in your sidebar. So basically, if you select levels of 0.6, 0.3, and 0.1, then the posts that are above 0.6 and below 1 will be listed and assigned a CSS Class of "fire". The ones between 0.3 and 0.6 will me assigned "medium". The next level will be "medium" and the last will be "mild" This will allow you to use CSS in your theme to style the posts and create a sort of "heat map". You could assign the fire level to be red, medium to be orange, etc. This is used in my sidebar, although i do not differentiate based on color. If you inspect the "popular posts" in the sidebar, the CSS classes are still there. I find that this is a useful way to display popular posts...whatever people are talking about the most should be a good metric for what is popular. You can view the code and download it here: https://github.com/matthewaprice/WordPress-Most-Commented-Posts-Widget
Post a comment





Real Time Web Analytics ^