WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Popular Posts
Custom post type support (35 posts)

  1. Akshay Raje
    Member
    Posted 2 years ago #

    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?

    Regards,
    Akshay

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

  2. raheelayub
    Member
    Posted 2 years ago #

    Hi Héctor,

    Yes I do agree with Akshay custom post type feature is mandatory as I received same demand from different clients as well.

    By the way we have added checkbox functionality in same plugin to achieve one of our client's requirement. Héctor, if you say I can share that code with you so others can get helped, we have added feature in shortcode so when user will enable that checkbox from shortcode (by adding attribute) then it will work otherwise checkbox won't appear on edit post page. :)

    I appreciate you have created excellent plugin which helps us a lot!!!

    Today I am facing trouble to resize image on 675x457 and its showing results at 675x198 which is weird :/ I also tried to use "thumbnail_selection" by adding following code in functions.php but failed. :(

    // Enable post thumbnails
    add_theme_support('post-thumbnails');

    and I also tried to change featured image dimentions from functions.php

    define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyten_header_image_width', 940 ) );
    define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyten_header_image_height', 198 ) );

    I hope you or somebody will be around to look at this post and help me as I have to fix this issue within next an hour.

    Thanks,

  3. Héctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    Hi guys,

    Sorry for not replying earlier, been quite busy in the past few weeks and just checked the forums.

    @Ashkay: sure, all contributions are welcome. Specially if it comes in form of patches to fix stuff / improve my plugin :) Let me know if you need any further help.

    @raheelayud: please do share your patch. I've been delaying this for far too long and you guys would do me and everyone using this plugin a tremendous favor.

  4. watermelonkid
    Member
    Posted 1 year ago #

    Hey guys,

    Just another vote for making this happen! Much appreciated for this great and very useful plugin--it will be invaluable once you can specify a custom post type!

    -B

  5. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    Hey guys,

    A quick update: I managed to get this working! It's been implemented already on the development version (not available yet) and it seems to be working just fine!

  6. raheelayub
    Member
    Posted 1 year ago #

    Hey Héctor Cabrera,

    I am sorry for the late reply. I have been busy finalizing couple of projects. I will find and get you that code in a day or two.

    Thanks,
    Raheel

  7. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Raheel,

    Sure, no problem! I've already managed to enable this functionality but I'd like to take a look into your mod. If your solution is better, I will implement it :)

  8. watermelonkid
    Member
    Posted 1 year ago #

    @hector/@raheelayud,

    Any luck? :) Sorry, I don't mean to be pushy--but building a site and it would be awesome if the Rahellayud's patch or your Hector's update were available soon!

  9. raheelayub
    Member
    Posted 1 year ago #

    Hey Héctor,

    Once again sorry for the late reply! :)

    Please find code file here:
    http://www.sleekwebstudio.com/hector/

    In [wpp] shortcode if you add "wpp_checkbox=1" attribute that will enable this feature and if you will not enable this then on each post edit page there will be message saying:

    "Please add "wpp_checkbox=1" in WordPress Popular Post [WPP] plugin shortcode to enable this feature."

    Once you enable this feature then it will show check box on each edit post page we set its limit "2" so once you increase that limit it will give error/warning message that you exceeded the limit to set popular posts.

    Once you download file please let me know.

    Also if you like then please don't forget us on next update. ;)

    Let me know if you need anything else?

    Thanks,
    Raheel Ayub
    skype: raheel.ayub
    http://www.sleekwebstudio.com

  10. raheelayub
    Member
    Posted 1 year ago #

    Hi watermelonkid,

    Code is up there now lets wait for Hector to implement it. :)

    Thanks,
    Raheel

    P.S. @Héctor, I developed this feature to enable "manual popular" posts so admin can set whatever post they want to show on frontend as popular post.

  11. watermelonkid
    Member
    Posted 1 year ago #

    Raheelayub,

    Thanks! I was trying to look at the code you posted, but when I try to click or download it, your server tells me not to download/open it directly. Maybe you should zip it up?

    -B

  12. raheelayub
    Member
    Posted 1 year ago #

    Just right click on file name and click on "save link as / save file as" it will give you option to save it on your local computer. :)

  13. watermelonkid
    Member
    Posted 1 year ago #

    That's what I did, and the file it saved didn't have the code in it!

  14. raheelayub
    Member
    Posted 1 year ago #

    Please check now! I just uploaded .zip as well.

  15. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    Hi guys,

    I made some modifications / upgrades to the plugin over the weekend and can confirm that the custom post type filter works. I'm also working on other upgrades that I'm sure you all will appreciate, once I'm done with these will release the development version so you can try it out.

    @raheelayub: I'm against the idea of letting the site admin decide which posts should appear as most popular on the list. This is because I believe that what measures the level of success of a blog post is the interactions it generates with your visitors and regular readers (views and comments).

    What you're after is more like a Featured Posts thingy that would allow me, the site admin, to manually pick posts to showcase to my readers. I happen to have another plugin lying around that does this already, just haven't published it yet since it needs more work to make it as flexible as WordPress Popular Posts.

    I will, however, take your idea into consideration but just not to use it on WordPress Popular Posts but on the new one. If this happens, I will credit you of course.

  16. raheelayub
    Member
    Posted 1 year ago #

    Héctor,

    You are right about popular posts and it should come up based on views/comments of users but our idea was exactly what you understand it was featured post option inside popular posts because this is what client asked us to do! Before they needed popular posts to show on home page but suddenly they requested that they want to select posts to display on home page rather its showing automatically so their users/ readers would read the best posts.

    I know there are plugins available for featured posts but your plugin is more stable and good that's why I suggested to add that option so if users are using this plugin then they shouldn't need to go anywhere.

    Thanks,
    Raheel

  17. tongas
    Member
    Posted 1 year ago #

    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.

    Thanks!

  18. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    @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 :)

  19. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  20. tongas
    Member
    Posted 1 year ago #

    gracias hector!

    seems to be working fine!

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

    thanks!

  21. Jeff Byrnes
    Member
    Posted 1 year ago #

    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:

    wpp_get_mostpopular('order_by=views&post_type=custom&post_type_name=post-type-name');

  22. geoff67
    Member
    Posted 1 year ago #

    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'),
    );
    wpp_get_mostpopular($args);

    OR
    wpp_get_mostpopular('order_by=views&post_type=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.

  23. geoff67
    Member
    Posted 1 year ago #

    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.

  24. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    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!

  25. geoff67
    Member
    Posted 1 year ago #

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

  26. jankowalski
    Member
    Posted 1 year ago #

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

  27. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  28. arthurdent2003
    Member
    Posted 1 year ago #

    Hello Héctor,

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

    thx!

    AD

  29. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    @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!

  30. jankowalski
    Member
    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic