Results 1 to 7 of 7

Thread: How to get average Rating - Structured Data

  1. #1
    Thread Starter
    Junior Member crixx's Avatar
    Join Date
    Aug 2011
    Location
    Munich
    Posts
    27
    Thanks
    4
    Thanked 1 Time in 1 Post

    How to get average Rating - Structured Data

    Since there is no markup for the listings ratings I try to solve this by a workaround.

    Now I need help to extract the average rating of a single listing. How could this be done?

    The code below works fine, if I use static values (f.ex. 3 oder 4.5) but I need the dynamic value of a single listing. The code in red doesn´t work - so here I need some help.

    Code:
      <div itemscope itemtype="http://data-vocabulary.org/Review-aggregate">
        <span itemprop="itemreviewed"><?php the_title(); ?></span>
        <span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating">
          <span itemprop="average"><?php va_get_rating_average(); ?></span>
          von <span itemprop="best">5</span>
        </span>
        based on <span itemprop="votes"><?php the_review_count(); ?></span>.
      </div>

  2. #2
    luxor's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    599
    Thanks
    8
    Thanked 141 Times in 74 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  3. #3
    Thread Starter
    Junior Member crixx's Avatar
    Join Date
    Aug 2011
    Location
    Munich
    Posts
    27
    Thanks
    4
    Thanked 1 Time in 1 Post
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #4
    Expired Customer alexsmv's Avatar
    Join Date
    Jun 2013
    Location
    Ukraine
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  5. #5
    localarchitect's Avatar
    Join Date
    May 2013
    Location
    United States
    Posts
    32
    Thanks
    3
    Thanked 1 Time in 1 Post
    You must be an AppThemes customer and logged in to view this response. Join today!

  6. #6
    danyz's Avatar
    Join Date
    Sep 2012
    Location
    Italy
    Posts
    191
    Thanks
    39
    Thanked 19 Times in 13 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  7. #7
    olmeca2005's Avatar
    Join Date
    Mar 2011
    Location
    Turkey
    Posts
    18
    Thanks
    4
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Sort Listings by average rating rather than date - Vantage
    By mwilson15 in forum Vantage General Discussion (Legacy)
    Replies: 1
    Last Post: July 27th, 2012, 03:07 PM
  2. How to add a 5 star rating to every ads?
    By harry0013 in forum ClassiPress General Discussion
    Replies: 2
    Last Post: May 7th, 2012, 04:12 PM