View Single Post
Old 08-10-2015, 07:42 PM  
ipolic
Confirmed User
 
ipolic's Avatar
 
Join Date: Nov 2003
Posts: 1,484
Your code is good if you wanna sort by VIEWS, but my plugin sorts by click thru ratio on index or category or tags.

So for example you can have 1 video which gets tons of traffic from referrals/SE/etc but on index it is not clicked a lot. Your solution would display this video on top of index, while mine would display what people actually CLICK

Quote:
Originally Posted by AbsolutePorn View Post
I already did something like that, since I'm using "Wp-PostViews", I can easily sort out the post based on the "Views".

For example...

http : // www . mysite . com /some-category-name/?sort=views

And then I changed the WP Query in the archive/category to:
Code:
if(isset($_GET['sort'])) { $_SESSION['sort'] = $_GET['sort']; }
if($sort == 'views') {
   query_posts($query_string.'&v_sortby=views&v_orderby=desc&posts_per_page=24');
} else {
   //do the regular query here...
}
The code above was adapted for this GFY Post Obviously you should sanitize all GET inputs, etc.
ipolic is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote