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
<?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
<?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
<?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
<?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
<?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
<?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