Last active
August 29, 2015 14:00
-
-
Save andornagy/11042008 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo render_stats($post->ID) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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