Ever wonder what your top 10 posts are? We installed the plugin WP-PostViews which keeps track of how many people have viewed each and every post.
The plugin does provide you with a way to view the top 10 posts which I am sure most people who install this would like to know. The problem is it needs to be called from within a page on your blog.
The application for this is that a user would want to display their top viewed post on their main site and not their blog.
I created this small script to view it on just a blank page. You can use this script yourself if you wish to view your Top 10 Posts.





Ajith
May 24, 2007 2:46 am
Well there is a major problem with your blog (as I think) there is no contact me form and no About me page. I know you can’t actually put the contact me here Gary but an About page can do more justice to readers
blogadmin
May 24, 2007 7:55 am
I am not sure how this relates to this topic.
There is no contact me or about us because this is not a personal blog. Those details can be found on our site already at http://www.bluefur.com.
Also on a side note I am not the only one that blogs here. If you view the writters of the blog you will see we have 5 people that blog.
phpguru
May 24, 2007 8:40 am
I have add these to the Navigation.
Thanks for the suggestion.
Matt
May 24, 2007 9:10 pm
You should just include wp-config.php and wp-includes/wp-db.php. Then, you can use built-in WP Database stuff. Here’s the file with a little bit of editing (I haven’t tested it, though):
http://mattsblog.ca/topposts.txt
Matt
May 24, 2007 9:26 pm
blogadmin, phpguru, brandit, Rhetorical… and who else? Or, are you counting Matthew Schmoll?
Matt
May 25, 2007 6:10 pm
Okay, I tested it, and fixed it. It works now! Here it is: :D
http://mattsblog.ca/topposts.txt
(feel free to use it and distribute it, if you want :) )
blogadmin
May 25, 2007 6:27 pm
Is there a working copy on your site?
I couldn’t find it ;)
Matt
May 25, 2007 6:46 pm
No, there wasn’t. I didn’t even have the Plugin installed. :P
I was testing it on localhost.
Well, I can now say it works with WordPress 2.1.3 and 2.2.
You can now see a working copy on My Blog here:
Matt’s Blog Top 10 Posts
blogadmin
May 25, 2007 6:47 pm
That looks like a top 2.
Matt
May 25, 2007 6:58 pm
I only installed the Plugin a couple of minutes ago, so once it’s been installed for a little while longer, it’ll be a Top 10. Trust me, I’ve tested it. :P
Matt
May 25, 2007 7:23 pm
I updated the file again, so that the results are in a numbered list.
http://mattsblog.ca/topposts.txt
Matt
May 25, 2007 7:29 pm
Updated, again… I’ve add no-cache headers to it.
http://mattsblog.ca/topposts.txt
Matt’s Blog » Blog Archive » Displaying Your Top 10 Posts
May 27, 2007 2:39 pm
[...] my script comes in. Okay, it isn’t totally my script. It’s a modified version of the Script BlueFur released for this same purpose. Except, I cleaned it up a bit and made it so it used WordPress functions, so [...]