Wordpress Plugin: Daily Top 10 Posts

Posted by Andrew on March 27th, 2007
Visited 19389 times, 52 so far today

Update: Please download the latest version to correct a flaw that prevents the daily count from incrementing.

If you want to know how much hits your posts are receiving on a daily basis, then the Daily Top 10 Posts plugin is just for you. What it does is track the hits of each blog post for the current day and cumulatively at the same time. You may also display sidebar widgets containing a list of the most popular posts for the day and most popular posts overall.

Plugin Name: Daily Top 10 Posts
Description: Tracks the number of pageviews per blog post for the current day and cumulatively with options to display sidebar widgets for both.
Author: Andrew dela Serna
Version: 0.3
Notice: Compatible with Wordpress 2.0-2.2.
Disclaimer: This is a standalone plugin. If you have been using the Top 10 plugin, please be advised that using the Daily Top 10 Posts plugin means your pageviews will, once again, start from zero.

Installation:

1. Download the plugin from http://www.alleba.com/blog/wp-downloads/dailytop10.zip
2. Extract and upload dailytop10.php to ‘yourserver.com/wp-content/plugins/’
3. Login to your Wordpress admin panel and browse to the Plugins section.
4. Activate The Daily Top 10 Posts plugin.

Instructions:

*A README.TXT file is included in the download. Please read that file if you’re having trouble viewing the instructions here.

1. Go to Admin Panel > Presentation > Theme Editor and click on Single Post (single.php).

Find this line:

<?php the_time('F jS, Y') ?> //date

Right after it, insert this line:

<br /><?php todays_overall_count($post->ID, 'Visited', 'times', 'so far today', '0', 'show'); ?>

*If set to ’show’, the line will display something like “Visited 300 times, 25 so far today” while viewing an individual post.
* You may edit the wording to suit your preference.
* If you wish to leave a word/phrase empty, use two quotes '' instead of just leaving it completely blank.
* Insert only one instance of this line to avoid double tracking.
* To track unique sessions, change 0 to 1 at the end.
* Change ’show’ to ‘noshow’ if you do not wish to display a visible counter.

2. To display the number of views per post on the main index page, click on Main Index Template (index.php) in the Theme Editor panel.

* Find this line:

<?php the_time('F jS, Y') ?>

* Right after it, insert this line:

<br /><?php todays_overall_main($post->ID, 'Viewed', 'times', 'so far today'); ?>

* The line will display something like “Visited 300 times, 25 so far today” under each post heading while browsing your main page.
* You may edit the wording to suit your preference.
* If you wish to leave a word/phrase empty, use two quotes '' instead of just leaving it completely blank.

3. To add the sidebar widget to show your most popular posts for the day, click on Sidebar (sidebar.php) in the Theme Editor panel.

* Add the following code:

<h3>Top Posts for Today</h3>
<?php todays_count_widget('views', 'ul'); ?>

* You may edit the word “views” to your liking (e.g. visits, pageviews or leave it empty '').
* The list format defaults to an unordered list (ul). If you would like an ordered list, change it to 'ol'.

4. To add the sidebar widget to show your most popular posts overall, click on Sidebar (sidebar.php) in the Theme Editor panel.

* Add the following code:

<h3>Overall Top Posts</h3>
<?php todays_overall_count_widget('views', 'ul'); ?>

* You may edit the word “views” to your liking (e.g. visits, pageviews or leave it empty '').
* The list format defaults to an unordered list (ul). If you would like an ordered list, change it to 'ol'.

Update: Now has the ability to track unique hits based on sessions. See instruction #1 for implementation.

0.2 Update: A serious flaw has been found that prevents the daily count from incrementing. Please download the latest version to correct this.

0.3 Update: Numerous bugs corrected. For more, read this post.

Credits: Thanks to Abe for the idea!

As always, I am open to your comments and suggestions. I hope you like this one! Thanks!

Bookmark at:
StumbleUpon | Digg | Del.icio.us | Dzone | Newsvine | Spurl | Simpy | Furl | Reddit | Yahoo! MyWeb

70 Comments

  • TDG said:

    Hey, is it possible to make this plugin use javascript to the post views can be tracked even when using the supercache plugin which uses static .html files?

    Thanks

  • Jeremy said:

    Is there anyway to have the links contain rel=”nofollow” so that on other pages of the site the pages will only be returning page rank to the front page and not to all the pages on the “top posts” pages?

  • Greener Pastures said:

    I love this idea!, and I have it up and running. The problem I’m seeing is that the counts don’t agree with my “Blog Stats” from WP. What time do your counts start? Do they go for a 24 hour period? Could you tell us a little more about it? Is there a way to increase or decrease the number of items listed?

    Thanks, again, for a great plugin!
    Lisa

  • simonkoleznik said:

    @JMD: put into index.php, right after and it will work. It does for me. ;)

  • Powerfull List of WordPress Lifesavers Plugins | SEO & Web Design said:

    […] Daily Top 10 Posts- Tracks the number of pageviews per blog post for the current day and cumulatively with options to […]

  • JMD said:

    I get the “No posts viewed yet” message after installing the plugin to the sidebar, to view the “Top 10 Posts” of the day. I do not have the single.php page, so obviously did not install the code into there? Is that code needed for the sidebar widgets to work?

  • JMD said:

    I do not have the single.php file in my theme? I only want to display the most popular posts, on my blog. Will this work without installing the code in the single.php file which I do not have on my theme.

  • 19 de pluginuri (must have) pentru Wordpress - Octav - Blog said:

    […] vei putea lista o serie de articole care le consideri de maxim interes. Live Demo Aici | Download Daily Top 10 Posts - Monitorizeaza numarul de pageviews pe fiecare post zilnic sau saptamanal. Iti ofera posibilitatea […]

  • 50 de pluginuri (must have) pentru Wordpress - Octavian Rizea - Blog said:

    […] vei putea lista o serie de articole care le consideri de maxim interes. Live Demo Aici | Download Daily Top 10 Posts - Monitorizeaza numarul de pageviews pe fiecare post zilnic sau saptamanal. Iti ofera posibilitatea […]

  • Jim said:

    Very nice plugin, i added this to my site and it works perfectly, really easy to modify as well. Good work m8!

  • Pages: [4] 3 2 1 » Show All


Post a Comment


Test Your Geography | Home | Talking on Television Is NOT A Right