Skip to content

Instantly share code, notes, and snippets.

@andornagy
Last active August 29, 2015 14:00
Show Gist options
  • Save andornagy/11042008 to your computer and use it in GitHub Desktop.
Save andornagy/11042008 to your computer and use it in GitHub Desktop.
<?php
function render_stats($post_id) {
$args = array(
'days'=>-1,
'limit'=>-1,
'post_id'=>$post_id
);
$result = stats_get_csv('postviews', $args);
$views = $result[0]['views'];
return number_format_i18n($views);
}
<?php
echo render_stats($post->ID)
<?php
if(function_exists('the_views')) { the_views(); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment