Stay Connected  Follow abhisays on Twitter   Connect to abhisays on Facebook  

Last Updated: September 27, 2012  175 views

How to display number of views for each post in WordPress?

in: Tips and Tricks

page viewsHello friends, I have found a?nice WordPress?plugin which can be used to display number of views for each post. This plugin is called WP-PostViews. It has been developed by?Lester ‘Gamerz’ Chan. It?enables you to display how many times a post or page of yours has been visited. I added this plugin few hours back.?And you know, I am more than five years late. I should have added this plugin five years back, when I started this blog. The plugin is very user friendly and?easy to implement. Let me know, if?you find any issues while adding this plugin to your blog.

To activate and install this plugin, you need to follow these steps ::

1. Install and activate WP-PostViews Plugin
2. Go to WP-Admin -> Settings -> PostViews to configure the plugin.
3. Find: <?php while (have_posts()) : the_post(); ?>
4. Add Anywhere Below It (The Place You Want The Views To Show): <?php if(function_exists(‘the_views’)) { the_views(); } ?>

abhisays wordpress views


You can also display most viewed posts in sidebar.? For this, you will have to use the following piece of code.

<?php if (function_exists(‘get_most_viewed’)): ?>
??? <ul>
??????? <?php get_most_viewed(); ?>
??? </ul>
<?php endif; ?>

To download this plugin, follow this link