[Tip] easily insert Google Rich Snippet with GD Star Rating
-
Hi,
I am using GD Star Rating in my wife’s website https://www.madame-coquille.com/. As this is a recipe website, I have added the “hRecipe” microformat for it to appear nicely on google with a picture and some informations. GDSR worked as expected but the rating box is added outside of the recipe itself, that’s no big deal but the rating would not be part of the whole hrecipe box. I really didn’t want to handle the layout myself, so I simply added the following to the function I created to automagically insert the recipe on a hrecipe container:
if (function_exists('gdsr_render_google_rich_snippets')) { $content .= '<!-- Google Rich snippets -->'; $content .= gdsr_render_google_rich_snippets(array('template_id' => 4), false); }
That will add a hidden rich snippet regarding the post’s score and will perfectly be interpreted by Google:
hrecipe [recipe stuff] hreview-aggregate item fn = The Recipe rating best = 5 average (normalized to 5.0 scale) = 5.0 average = 4.8 count = votes = 4
Thanks for this great plugin!
- The topic ‘[Tip] easily insert Google Rich Snippet with GD Star Rating’ is closed to new replies.