I tried using the
AggregateRating and used the code below. The values of
$total_reviews is not empty, and tried printing its value.
Now I added the code inside my WordPress post, and checked the preview on Google's rich snippet testing tool.
AggregateRating is not showing.
<div itemscope="" itemtype="http://schema.org/AutoRepair"> <strong><span itemprop="name">GMD Auto Shop</span></strong> [php] echo "<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"> <span itemprop="ratingValue">". $aggregate_rating . " </span> stars for <span itemprop="reviewCount">" . $total_reviews . "</span></div>reviews."; [/php] <span itemprop="streetAddress">Kamagong Street, Lahug</span> <div itemprop="address" itemscope="" itemtype="http://schema.org/PostalAddress"><span itemprop="addressLocality">Cebu City</span>, <span itemprop="addressRegion"> Cebu</span> <span itemprop="postalCode">6000</span> </div> Phone: <span itemprop="telephone">032-417-4700</span> <div itemprop="geo" itemscope="" itemtype="http://schema.org/GeoCoordinates">Latitude: 40 deg 44 min 54.36 sec N Longitude: 123° 54.037' <meta itemprop="latitude" content="40.75" /> <meta itemprop="longitude" content="54.98" /> </div> </div>
http://schema.org/AutoRepairis a valid itemtype, in my experience any itemtype other than
http://schema.org/Productdoes not show in the rich snippet testing tool. I find this frustrating as it means listing organisations as products. Although the above will get your rating shown in the snippets tool, I am interested to know if there is a solution that allows us to use the correct itemtype and see a rating in the rich snippets tool.
<?php>. Also, you are using a double quoted string with double quotes inside it. There is no way that what you pasted in would print out valid markup that Google's tool could understand.
[php]is like a short code.