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