WordPress.org

Forums

WordPress Popular Posts
[resolved] [Plugin: WordPress Popular Posts] Updated plugin to include custom post type support (2 posts)

  1. Brad Williams
    Member
    Posted 3 years ago #

    We had a client who wanted to use this plugin with their custom post types, so I modified the original plugin to support a post_type parameter. You can pass in a single post type, or multiple like so:

    wpp_get_mostpopular( "post_type=page" );

    wpp_get_mostpopular( "post_type=post,page,events,custom-post-type-name" );

    This also works with the shortcode:

    [wpp post_type='post,page,events']

    The code is up on Github: https://github.com/williamsba/WordPress-Popular-Posts-with-Custom-Post-Type-Support

    The only file modified from the original version is wordpress-popular-posts.php. Hope this helps others!

    http://wordpress.org/extend/plugins/wordpress-popular-posts/

  2. Hector Cabrera
    Member
    Plugin Author

    Posted 3 years ago #

    Hi Brad,

    Thanks for sharing this. I had already included this on the development version, still took a look at your modifications and borrowed a couple of ideas. Hope you don't mind. Will still credit you for them, of course.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WordPress Popular Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.