Title: [Plugin: WordPress Popular Posts] include custom post types?
Last modified: August 19, 2016

---

# [Plugin: WordPress Popular Posts] include custom post types?

 *  [cpkid2](https://wordpress.org/support/users/cpkid2/)
 * (@cpkid2)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-template-tag-options/)
 * Anyway to include custom post types into the list?

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

 *  Thread Starter [cpkid2](https://wordpress.org/support/users/cpkid2/)
 * (@cpkid2)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-template-tag-options/#post-1980822)
 * I noticed that if I add `pages=1` to the list of attributes, it shows everything
   including the posts in my custom post types and pages. However, if I use `pages
   =0`, it only shows the posts in the default post type. Is there a way to only
   get rid of the actual pages?
 *  Thread Starter [cpkid2](https://wordpress.org/support/users/cpkid2/)
 * (@cpkid2)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-template-tag-options/#post-1981012)
 * I found that on line 496, changing `post` to another post type worked. So how
   can I add in an array of post types? I’m not much of a coder so I’m not sure 
   how I’d put it in.
 * `$nopages = "AND $wpdb->posts.post_type = 'projects'";`
 *  Thread Starter [cpkid2](https://wordpress.org/support/users/cpkid2/)
 * (@cpkid2)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-template-tag-options/#post-1981015)
 * Ok, I got some help and found the solution.
 * Around line 496, change this:
 * `$nopages = "AND $wpdb->posts.post_type = 'post'";`
 * To this:
 * `$nopages = "AND $wpdb->posts.post_type IN ('post','videos','projects')";`
 * With `videos` and `projects` being the custom post types.
 * Hope this helps someone out there.

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

The topic ‘[Plugin: WordPress Popular Posts] include 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/)

 * 3 replies
 * 1 participant
 * Last reply from: [cpkid2](https://wordpress.org/support/users/cpkid2/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-wordpress-popular-posts-template-tag-options/#post-1981015)
 * Status: not resolved