WordPress.org

Ready to get started?Download WordPress

Forums

kk Star Ratings
[resolved] Ordering posts with same rating average (2 posts)

  1. adambundy
    Member
    Posted 2 years ago #

    The plugin doesn't seem to promote posts with more perfect votes over those with fewer, but the same average star-rating. Could that be implemented or considered a feature request? It seems that when listing the top rated posts, those with the same average are listed chronologically by post date and ascending, so that an old post with a perfect rating that doesnt get any lower ratings will continue to be the top rated post forever. Am I incorrect?

    I am using the following function to show top-rated posts in a widget and the client complained that the same older post has been top-rated for several months. There are a few 100%-rated posts. If I could promote those with more perfect ratings over those with fewer, then order those posts with the same number of perfect ratings by post date or ID ("DESC"), that would be great.

    <?php if(function_exists('kk_star_ratings_get')) : $top_rated_posts = kk_star_ratings_get(3); endif; 
    
    foreach($top_rated_posts as $post)
    {
       $post_id = $post->ID;
       $queried_post = get_post($post_id);
    
       echo "<li id='rated-post-id-" . $post_id . "'>";
       echo "<a href='".get_permalink($post_id)."'>";
       echo get_the_post_thumbnail($post_id, 'top-rated');
       echo "</a><a href='".get_permalink($post_id)."'>".$queried_post->post_title."</a>";
       echo " <span style='font-size:10px;'>(".$post->ratings."/5)</span>";
       echo "<p class='excerpt'>";
       echo substr($queried_post->post_content, 0, 120);
       echo "&hellip;</p>";
       echo "<br></li>";
    }?>

    Thanks!

    http://wordpress.org/extend/plugins/kk-star-ratings/

  2. Kamal Khan
    Member
    Plugin Author

    Posted 2 years ago #

    Yes, I got some complaints about this before.

    I sure have to fix this in the next version. I am a bit busy with other projects at the moment. I will apply this asap.

    Thank you for your interest

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic