Overall rating
-
Hi,
I am displaying overal rating on my main index with [RICH_REVIEWS_SNIPPET category=”page”id=”60″]:
Overall rating: ★★★★★ based on 2 reviewsIs there any way to display overal rating on my main index ony with stars, with no text “Overall rating: … based on 2 review”?
★★★★★Thanks
-
So this text is part of what contains the schema data that Google data crawlers will be looking for, so you don’t want to explicitly hide it. However, there are a few workarounds. For instance if you wrap the snippet shortcode in a container with a targetable class, then apply some css to reduce the font-size of everything, except the stars, to nothing, you can get the effect of removing the text without actually doing so.
For instance:
<div class="aggregate-rating"> [RICH_REVIEWS_SNIPPET category="page" id="60] </div> <style> .aggregate-rating { font-size: 0px; text-align: center; } .aggregate-rating .stars { font-size: 22px; } </style>That should do what you are looking for. Note: the font-size of 22px for the stars is arbitrary, you can style the stars however you like, as well as the container and whatnot (ie: the
text-align: center;). the key is simply applyingfont-size: 0;to the container then targeting the.starselement within to override the font reduction.Let me know if you need any further help.
Thanks,
Charlie Maxwell
[NM_Developer]Thanks, that worked! 🙂
The topic ‘Overall rating’ is closed to new replies.