• Resolved Naveen_Sharma

    (@naveen_sharma)


    Dear Experts,

    I am using stats_get_csv to get number of post views for individual posts by passing the POST_ID. But, it is returning all post views.

    Please help me, its already taken a long time.

    Here is the function code I am using for this purpose :
    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);
    }

Viewing 12 replies - 1 through 12 (of 12 total)
Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘stats_get_csv returning number of page views for all posts’ is closed to new replies.