Support » Plugin: WordPress Popular Posts » [Plugin: WordPress Popular Posts] Custom post type support

  • Hi Héctor,

    WordPress-popular-posts is a brilliant plugin and it has a great userbase too. There have been requests of adding support for custom post type and one of my clients needs this feature.

    I have gone thru the code and will work on a patch to add this functionality. If all works well, would you absorb this in your plugin so that others will also benefit from this effort?


Viewing 15 replies - 16 through 30 (of 34 total)
  • Hey Hector!

    First of all thanks for your great plugin!

    I was looking around for the custom posts fix and after finding anything that worked well I ended up here. I am glad you sorted that out and if you have a beta version before the official release, I would really appreciate if you share it with us before.


    Plugin Author Héctor Cabrera


    @raheelayub: what I meant to say is that I made a plugin that does that, just haven’t published it yet 😉 If I ever do, will post it here so anyone can try it out (and probably would upload it to the WordPress Plugin Directory as well).

    @tongas: stay tuned, I’ll be posting it here after I get some stuff sorted out 🙂

    Plugin Author Héctor Cabrera


    Alright, here it is! Please keep in mind that this is a development version and even though I did a full test of everything some bugs might show up.

    There are some new, yet to be documented features in this release. You might want to give them a try and post feedbacks here.

    gracias hector!

    seems to be working fine!

    nice mod to add the possibility of choosing by custom post, page or category!


    As it’s not immediately clear, if anyone else comes here & wants to use this plugin w/ Custom Post Types, here’s the syntax for a template tag:


    What’s the reasoning behind changing the way post_type usually works in a query (by adding post_type_name as a parameter)?

    Would it not be simpler to say:

    $args = array(
        'orderby' => 'views',
        'post_type' => array('posts','pages','custom-post-type'),


    And ditch the pages parameter altogether. If you want to keep backwards compatibility, setting pages to false or true would simply add it into the post_type array.

    Additionally, you could do what I’ve done in the meantime:
    Change $nopages = "AND $wpdb->posts.post_type = 'post'"; to $nopages = "AND $wpdb->posts.post_type != 'page'";

    … which is really how the pages parameter should work.

    Plugin Author Héctor Cabrera


    Hi geoff,

    This is the reason why I posted the development version here. Different points of view are better than just one (mine), and usually leads to better ideas.

    If you don’t mind, I will use your suggestion instead.

    Thanks for sharing!

    Go ahead. Love the plugin, so thanks for all of the work so far.

    so can you use one of those options and realase official update? i d like to test it.

    Plugin Author Héctor Cabrera


    The development version posted here is pretty much a Release Candidate. You can give it a try if you want or wait until I release the official version after I’m done with some stuff I’m working on now.

    Hello Héctor,

    will it also be possible to show popular posts of a custom post type with “views” insteaf of comments?



    Plugin Author Héctor Cabrera


    @ad: Yes, it is possible. My plugin tracks this info for custom post type as well. All you need to do is enable the show views option it to show this info.

    Everyone: I’m removing the development version now since all pending updates / changes to the plugin have been done already. Will test it for a few more days and release an official update soon.

    There are a couple of new features not present in the development version posted here that might break stuff once you upgrade to the official version. If that happens, please let me know.

    Thanks for your feedback!

    hector, make sure to inclue shortcode to filter by custom post type in your next release! Many thanks

    Is this the reason I’m getting this error?

    Warning: Missing argument 2 for standard_process_link_post_format_title() in /home/downsynd/public_html/ on line 2713

Viewing 15 replies - 16 through 30 (of 34 total)
  • The topic ‘[Plugin: WordPress Popular Posts] Custom post type support’ is closed to new replies.