Plugin Directory

WP-PostViews

Enables you to display how many times a post/page had been viewed.

How To View Stats With Widgets?

  • Go to WP-Admin -> Appearance -> Widgets
  • The widget name is Views.

How To View Stats (Outside WP Loop)

To Display Least Viewed Posts

  • Use:
<?php if (function_exists('get_least_viewed')): ?>
    <ul>
        <?php get_least_viewed(); ?>
    </ul>
<?php endif; ?>
  • The first value you pass in is what you want to get, 'post', 'page' or 'both'.
  • The second value you pass in is the maximum number of post you want to get.
  • Default: get_least_viewed('both', 10);

To Display Most Viewed Posts

  • Use:
<?php if (function_exists('get_most_viewed')): ?>
    <ul>
        <?php get_most_viewed(); ?>
    </ul>
<?php endif; ?>
  • The first value you pass in is what you want to get, 'post', 'page' or 'both'.
  • The second value you pass in is the maximum number of post you want to get.
  • Default: get_most_viewed('both', 10);

To Display Least Viewed Posts By Tag

  • Use:
<?php if (function_exists('get_least_viewed_tag')): ?>
    <ul>
        <?php get_least_viewed_tag(); ?>
    </ul>
<?php endif; ?>
  • The first value you pass in is the tag id.
  • The second value you pass in is what you want to get, 'post', 'page' or 'both'.
  • The third value you pass in is the maximum number of post you want to get.
  • Default: get_least_viewed_tag(1, 'both', 10);

To Display Most Viewed Posts By Tag

  • Use:
<?php if (function_exists('get_most_viewed_tag')): ?>
    <ul>
        <?php get_most_viewed_tag(); ?>
    </ul>
<?php endif; ?>
  • The first value you pass in is the tag id.
  • The second value you pass in is what you want to get, 'post', 'page' or 'both'.
  • The third value you pass in is the maximum number of post you want to get.
  • Default: get_most_viewed_tag(1, 'both', 10);

To Display Least Viewed Posts For A Category

  • Use:
<?php if (function_exists('get_least_viewed_category')): ?>
    <ul>
        <?php get_least_viewed_category(); ?>
    </ul>
<?php endif; ?>
  • The first value you pass in is the category id.
  • The second value you pass in is what you want to get, 'post', 'page' or 'both'.
  • The third value you pass in is the maximum number of post you want to get.
  • Default: get_least_viewed_category(1, 'both', 10);

To Display Most Viewed Posts For A Category

  • Use:
<?php if (function_exists('get_most_viewed_category')): ?>
    <ul>
        <?php get_most_viewed_category(); ?>
    </ul>
<?php endif; ?>
  • The first value you pass in is the category id.
  • The second value you pass in is what you want to get, 'post', 'page' or 'both'.
  • The third value you pass in is the maximum number of post you want to get.
  • Default: get_most_viewed_category(1, 'both', 10);

To Sort Most/Least Viewed Posts

Requires: 2.8 or higher
Compatible up to: 3.5.1
Last Updated: 2013-5-8
Downloads: 851,588

Ratings

4 stars
4.2 out of 5 stars

Support

0 of 15 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Works!

5 people say it works.
0 people say it's broken.

100,2,2 100,1,1
100,3,3
0,1,0 0,1,0 0,1,0 0,1,0 0,1,0 60,5,3
0,1,0 0,1,0 0,1,0 0,1,0 0,1,0 33,18,6
0,1,0 0,1,0 0,1,0 0,1,0 0,1,0 78,9,7
0,1,0 0,1,0 0,1,0 0,1,0 0,1,0 69,16,11
0,1,0 0,1,0 0,1,0 0,1,0 0,1,0 57,14,8
0,1,0 0,1,0 0,1,0 0,1,0 0,1,0 67,18,12 0,1,0
0,1,0 0,1,0
33,3,1 0,1,0
100,1,1 0,1,0
75,4,3
100,3,3 59,22,13
60,5,3
100,2,2
40,5,2
100,2,2
88,17,15
50,2,1
69,16,11
100,2,2 50,2,1
100,3,3
83,12,10
100,6,6
100,4,4
71,7,5 100,5,5