Wp-Postviews Plugin, Sort and Reset

This site is using WP-PostViews Plugin by Lester Chan to determine and display the number of views of each blog post. With this, Pinoy Link Exchange can sort blogposts according to number of views. Blogpost with the most number of views gets on the top of the page.

Using WP-PostViews Plugin and the code below, lets you sort your blogpost according to views instead of the normal sort, which is by date.

<?php query_posts(‘v_sortby=views&v_orderby=desc’) ?>

Every first day of the month, Pinoy Link Exchange reset the number of views of each blogpost to 1. To do this, just go to your cpanel, backup your database, and using phpMyAdmin execute the query below;

UPDATE `wp_postmeta` SET meta_value = 1  WHERE `wp_postmeta`.meta_key =’views’ ;

It will initialize the number of views of each blog post to 1.

Comments

Leave a Reply

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