Great plugin! I need a bit of help figuring out how to show show 3 different ‘top posts’ lists though. I’m not using widgets so I’m looking to add the code directly into my theme files:
1 – Top 5 posts of the week.
I’ve already got this one partially working using the function below. Currently it just shows the post title and number of votes received for each one. Is there any way to show the rating stars and rating text in addition and sort them highest to lowest?
2 – Top 5 posts of the week by tag.
Same as above except I want to list the top 5 posts for a specific tag (e.g. football posts tagged ‘Arsenal’).
3 – Top 5 rated categories
This needs to list the top 5 categories by their average post ratings, highest to lowest.
Can this be achieved using the ‘expand_ratings_template’? I’ve seen it mentioned here but haven’t seen any documentation on how to use it.
Thanks for any help you can offer!
Okay, so far I’ve achieved the first one by creating a new function based on get_highest_score_range() and changing the output in wp-postratings.php to look like I wanted.
Number 2 and 3 are a lot more complicated and require SQL skills which I’m currently attempting to learn but its a bit above my current level!
I have a questoin that how to fetch the post image of the top rated post
I have use the
and thanks in advance.
I have the same question as a148, how to fetch post img with ratings :$
I will not provide details on customization, but I can provide tips.
1. Study http://codex.wordpress.org/Template_Tags/query_posts
<?php query_posts($query_string.'&r_sortby=highest_rated&r_orderby=desc') ?>
Any interest in sharing how you got sorting to work? I just want to create pages based on their ratings. eg: 5 star posts, 4 star posts, etc…
I’m using this with WooCommerce so it’d basically be sorting the top rated products. I’ll throw some cash your way for some help!
I ended up editing the postratings-stats.php file to include some additional functions of my own (based on the existing ones) that would output the results of my custom SQL queries. I then executed those functions in my theme template where I wanted the posts to appear.
I still don’t get it.
Where and how am i supposed to insert my category-id here;
<?php if (function_exists('get_highest_score_category')): ?> <ul> <?php get_highest_score_category(CATEGORY_ID); ?> </ul> <?php endif; ?>
[Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your posted code may now have been permanently damaged/corrupted by the forum’s parser.]
- The topic ‘[Plugin: WP-PostRatings] How to display 'top post' lists’ is closed to new replies.