WordPress.org

Ready to get started?Download WordPress

Forums

GD Star Rating
Display average of a multiple rating in loop (7 posts)

  1. Chritchan
    Member
    Posted 1 year ago #

    Hi,

    I've a multiple rating set and I would like to display an average text result in the loop.

    Is it possible and how to ?

    http://wordpress.org/extend/plugins/gd-star-rating/

  2. Chritchan
    Member
    Posted 1 year ago #

    mmh ... here is the awnser ...

    Display a numeric value average

    wp_gdsr_rating_multi

    $gp_gdsr = wp_gdsr_rating_multi();
    echo $gp_gdsr->rating;

    Display a rating star average

    wp_gdsr_multi_rating_average

    wp_gdsr_multi_rating_average();
  3. martkiss
    Member
    Posted 1 year ago #

    thx so much for your answer!

  4. Joe
    Member
    Posted 1 year ago #

    Thumbs up for you! Thanks!

  5. Joe
    Member
    Posted 1 year ago #

    Did you actually get the numerical value average working? I can't get it to work with your code. Any ideas?

  6. Chritchan
    Member
    Posted 1 year ago #

    Hi Joe,
    Yes my code is still working. I'm in WordPress 3.6 and GD Star Rating 1.9.22

    $gp_gdsr = wp_gdsr_rating_multi();
    if($gp_gdsr->rating != "0"){
    	wp_gdsr_multi_rating_average();
    	echo $gp_gdsr->rating;
    }

    You're inside of outside the loop ?

  7. Joe
    Member
    Posted 1 year ago #

    For me that shows the stars. I'm talking about literally just "7/10" for example.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.