Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jason Crouse

    (@coolmann)

    Hi,

    we are (still) working on the documentation. What you can do is to include wp-slimstat-db.php and then do:

    $filters = 'content_id equals ' . $post->ID;
    wp_slimstat_db::init( $filters );
    $count_post_views = wp_slimstat_db::count_records();

    where $post->ID is the global object and can be replaced with other WP functions depending on where you are (inside the Loop, etc).

    Please note that by default, count_records returns the number of pageviews during the current month. If you want ALL the pageviews from the beginning, you’ll use:

    wp_slimstat_db::count_records( ‘id’, ”, false);

    Hope this helps,
    Camu

    Thread Starter Stefano

    (@ste_95)

    Thanks man, that was really helpful! This has just allowed me to allow integration of your plugin with mine ??

    Plugin Author Jason Crouse

    (@coolmann)

    I tested your plugin and integration, well done sir! ?? We’re working on the documentation (sigh!) to allow other developers to do what you did.

    Thread Starter Stefano

    (@ste_95)

    Thanks! I do well understand what you’re going through: the documentation for my own plugin is poor and it would just be such a giant effort to write all that would be needed!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP function to retrieve single post visits’ is closed to new replies.