WP-PostViews – WordPress plugin Free download

Click to Download

WP-PostViews

Description

Usage

Open wp-content/themes/<YOUR THEME NAME>/index.php
You may place it in archive.php, single.php, post.php or page.php also.
Find: <?php while (have_posts()) : the_post(); ?>
Add Anywhere Below It (The Place You Want The Views To Show): <?php if(function_exists('the_views')) { the_views(); } ?>
Or you can use the shortcode [views] or [views id="1"] (where 1 is the post ID) in a post
Go to WP-Admin -> Settings -> PostViews to configure the plugin.

Build Status

Development

https://github.com/lesterchan/wp-postviews/

Translations

http://dev.wp-plugins.org/browser/wp-postviews/i18n/

Credits

Plugin icon by Iconmoon from Flaticon

Donations

I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks, I will really appreciate it. If not feel free to use it without any obligations.

Screenshots

PostViews
Admin – PostViews Options

FAQ

How To View Stats With Widgets?

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

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 the post type that you want. If you want to get every post types, just use ‘both’. It also supports PHP array: example array('post', 'page').
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 the post type that you want. If you want to get every post types, just use ‘both’. It also supports PHP array: example array('post', 'page').
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
Now I can independently control the logic of counting! Like this:

function exclude_wp_post_views_count($should_count, $id) {
if ( current_user_can('administrator') ) { // or other condition(s)
$should_count = false;
}
return $should_count;
}
add_filter('postviews_should_count', 'exclude_wp_post_views_count', 10, 2);

Leave a Reply

Your email address will not be published. Required fields are marked *