gdsr_render_google_rich_snippets

gdsr_render_google_rich_snippets($settings = array(), $echo = true)

  • $settings: parameters to display the Google rich snippet
  • $echo: true to display the block, false to return it as a value

With this function you can add Google Rich Snippet anywhere on the page. Settings is array with parameters:

  • hidden: true / false, is the block is to be displayed or not.
  • format: snippet format. only microformat is supported.
  • source: what type of ratings to use.
  • post_id: ID of the post to display snippet for


Source parameter can have these values:

  • standard_rating
  • standard_review
  • multis_rating
  • multis_review
  • thumbs

Example:
This will add multi rating block for post with ID 14.

[php]gdsr_render_google_rich_snippets(array(
"source" => "multi_rating",
"post_id" => 14));[/php]

Comments

Leave a Reply