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!
@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 🙂
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!
thanks!
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');
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.
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.
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!
Héctor,
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.
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?
thx!
AD
@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/noahsdad.com/wp-content/themes/standard/functions.php on line 2713