Wasn’t planning on that but it’s a great idea.
I don’t like plugins add useless widgets to the admin so I think that the shortcode seems the best way to go.
How would the shortcode work? How should we order the posts? A simple order by most positive votes ASC?
Thread Starter
togur
(@togur)
The shortcode sounds ok. If would be great to have possibility using php tag as well (for inserting into template).
It would display list of posts: title + number of voting in brackets. (default 5 posts)
Ordering by most positive votes by number of votes.
Optional parameters:
– number posts to display in list
– category (display most positive votes from one category)
Gotcha!
Is there a page in the Codex for that “php tag”? I’m not familiar with it (at least I think I’m not).
Maybe it’s simply like this:
<?= do_shortcode('[thumbs-rating-top]'); ?>
I like the parameters you posted:
- Number of post (default = 5)
- Category ID
What about the output? Could we someone be able to set what do we want to print with shortcode parameters?
I mean, you might want to print any of the following:
- Post Title
- Post Title +25
- Post Title +24 -15
What about setting these 3 different output being 1 the default so you could choose?
Thread Starter
togur
(@togur)
> Is there a page in the Codex for that “php tag”?…
Take a look at
http://codex.ww.wp.xz.cn/Function_Reference/do_shortcode
(Unfortunately I am a newbie in PHP & WP programming so I can’t be more helpful.)
> What about the output?…
Sorry, I don’t understand an example. What does means:
“Post Title +24 -15”
Alright togur, I already knew about do_shortcode π
About the output I meant what should the plugin print. Don’t worry I’ll figure something out π
cheers.
The 1.5 version is out!
It has a shortcode to show the most voted posts.
Let me know if you find any problem with it.
Cheers.
Thread Starter
togur
(@togur)
Excellent! I have tested it on WP 3.6 – without problem. Thanks.
Can i use this shortcode in widgets? So that top rated posts would be on side panel.
Hi Blagochevsky,
Yes, absolutely! π
Paste the shortcode in a Text Widget.
If it doesn’t work, you’ll need to allow shortcodes in your text widgets.
It’s very simple: http://php.quicoto.com/how-to-allow-shortcodes-to-wordpress-comments/
Cheers.