Support » Plugin: WP-PostRatings » PHP or Short Code of Rating

  • Hi,

    I am using your plugin for my online gaming site. I want to put the aggregate rating json schema markup within the head section of each game page.

    Is there any php or shortcode which will print average ratings and the total number of users rated for the post individually, so that each time a user vote a post it will dynamically comes within json script.

    The json script will be look like below:

    <script type=”application/ld+json”>
    {
    “@context”: “http://schema.org/&#8221;,
    “@type”: “VideoGame”,
    “name”: “Game Name”,
    “description”: “Game description”,
    “publisher”: “Publisher Name”,
    “aggregateRating”: {
    “@type”: “AggregateRating”,
    “ratingValue”: “here will print the average rating”,
    “bestRating”: “5”,
    “ratingCount”: “here will print the total number of users rated”
    },
    }
    </script>

    Your help really appreciated!

    • This topic was modified 4 years, 4 months ago by Jas Saran.

    The page I need help with: [log in to see the link]

  • The topic ‘PHP or Short Code of Rating’ is closed to new replies.