I'd like to track views on custom post types using "wpp_get_views()". I noted this post by "learnthat" which offered some good clues, but applies to Widgets, which I'm not using.
Any suggestions?
I'd like to track views on custom post types using "wpp_get_views()". I noted this post by "learnthat" which offered some good clues, but applies to Widgets, which I'm not using.
Any suggestions?
Hi Jonathan,
Actually, the wpp_get_views method queries the wpp_popularpostsdata table to get the views count of a given post ID. The post type isn't really neccesary here.
Are you sure that you're passing a valid ID to the function?
I've tried:
<?php wpp_get_views($post->ID); ?>
And:
<?php wpp_get_views('17'); ?> (Targetting a specific post)
To no apparent avail.
You need to echo it, my friend ;)
<?php echo wpp_get_views($post->ID); ?>
..Nice :)
Thank you for pointing that out!
It works beautifully.
This topic has been closed to new replies.