Skip to content

Commit

Permalink
Update README.md to use WP meta_key for query_posts() + Fixed notice for
Browse files Browse the repository at this point in the history
  • Loading branch information
lesterchan committed Sep 4, 2013
1 parent 42a1292 commit 2dfab09
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ Enables you to display how many times a post/page had been viewed.
* 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 appericiate it. If not feel free to use it without any obligations.

## Changelog
### Version 1.66
* NEW: Add China search engines bots
* FIXED: Notices and better way to get views from meta. Props daankortenbach.

### Version 1.65 (02-06-2013)
* FIXED: Views not showing in WP-Admin if "Display Options" is not set to "Display to everyone"

Expand Down Expand Up @@ -238,6 +242,6 @@ N/A
* Default: get_most_viewed_category(1, 'both', 10);

### To Sort Most/Least Viewed Posts
* You can use: `<?php query_posts('v_sortby=views&amp;v_orderby=desc') ?>`
* Or pass in the variables to the URL: `http://yoursite.com/?v_sortby=views&amp;v_orderby=desc`
* You can replace desc with asc if you want the least viewed posts.
* You can use: `<?php query_posts( array( 'meta_key' => 'views', 'orderby' => 'meta_value_num', 'order' => 'DESC' ) ); ?>`
* Or pass in the variables to the URL: `http://yoursite.com/?v_sortby=views&v_orderby=desc`
* You can replace DESC with ASC if you want the least viewed posts.
3 changes: 2 additions & 1 deletion wp-postviews.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: WP-PostViews
Plugin URI: http://lesterchan.net/portfolio/programming/php/
Description: Enables you to display how many times a post/page had been viewed. Modified by <a href="http://DPotter.net/Technical/" title="David's Technical Musings">David Potter</a> to include options for when and where to display view counts.
Version: 1.65
Version: 1.66
Author: Lester 'GaMerZ' Chan
Author URI: http://lesterchan.net
Text Domain: wp-postviews
Expand Down Expand Up @@ -131,6 +131,7 @@ function wp_postview_cache_count_enqueue() {
global $user_ID, $post;
if (!wp_is_post_revision($post) && (is_single() || is_page())) {
$views_options = get_option('views_options');
$should_count = false;
switch(intval($views_options['count'])) {
case 0:
$should_count = true;
Expand Down

0 comments on commit 2dfab09

Please sign in to comment.