Title: [Plugin: WordPress Popular Posts] View count empty on Custom Post Types
Last modified: August 19, 2016

---

# [Plugin: WordPress Popular Posts] View count empty on Custom Post Types

 *  Resolved [Jonathan Wold](https://wordpress.org/support/users/jonathanwold/)
 * (@jonathanwold)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-view-count-empty-on-custom-post-types/)
 * I’d like to track views on custom post types using “wpp_get_views()”. I noted
   [this post by “learnthat”](http://wordpress.org/support/topic/427508?replies=5)
   which offered some good clues, but applies to Widgets, which I’m not using.
 * Any suggestions?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Héctor Cabrera](https://wordpress.org/support/users/ikki24/)
 * (@ikki24)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-view-count-empty-on-custom-post-types/#post-1600383)
 * 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?
 *  Thread Starter [Jonathan Wold](https://wordpress.org/support/users/jonathanwold/)
 * (@jonathanwold)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-view-count-empty-on-custom-post-types/#post-1600641)
 * I’ve tried:
    `<?php wpp_get_views($post->ID); ?>`
 * And:
    `<?php wpp_get_views('17'); ?>` (Targetting a specific post)
 * To no apparent avail.
 *  [Héctor Cabrera](https://wordpress.org/support/users/ikki24/)
 * (@ikki24)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-view-count-empty-on-custom-post-types/#post-1600643)
 * You need to echo it, my friend 😉
 * `<?php echo wpp_get_views($post->ID); ?>`
 *  Thread Starter [Jonathan Wold](https://wordpress.org/support/users/jonathanwold/)
 * (@jonathanwold)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-view-count-empty-on-custom-post-types/#post-1600718)
 * ..Nice 🙂
 * Thank you for pointing that out!
 * It works beautifully.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Plugin: WordPress Popular Posts] View count empty on Custom Post Types’
is closed to new replies.

 * ![](https://ps.w.org/wordpress-popular-posts/assets/icon-256x256.png?rev=1232659)
 * [WP Popular Posts](https://wordpress.org/plugins/wordpress-popular-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-popular-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-popular-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-popular-posts/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Jonathan Wold](https://wordpress.org/support/users/jonathanwold/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-view-count-empty-on-custom-post-types/#post-1600718)
 * Status: resolved