Hi all - first of all thanks for the great work on developing Directory so far, having great fun getting our teeth into customising our latest project.
We've hit a blockade trying to introduce valid schema markup into the review postings, in order to generate correctly indexed Google listings as per Schema.org review guidelines.
I've started basic, and managed to get some of the more simple fields to append pretty instantly (for instance:
<div class="sr-rate-this" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"> ... <span>(<span class="all_votes-<?php echo $post->ID; ?>" itemprop="reviewCount"><?php echo $rating['votes'] ?></span> reviews)</span>
over at Google Structured Data Testing Tool.
I'm currently struggling with assigning ratingValue to my average star rating (key to the look of the listing in Google as it uses this to display the 'stars' on the search result) - of course, when assigned to the following block:
<div class="sr-rate-this" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"><strong itemprop="ratingValue"><?php _e('Overall:', DR_TEXT_DOMAIN); ?></strong>
All I get returned is the 'Overall:' string, with no rating appended:
I've attempted to look into coding the itemprop variable into the code at a function level - but I can't find anywhere that a flat, numeric variable (1-5) is generated for the rating.
Any help with this would be greatly appreciated - it's the one major tickbox in my opinion that stops this from making the transition to a viable industry choice
for this type of directory site.
Thanks for the hard work guys, over to you! :slight_smile: