Ready to get started?Download WordPress


[resolved] How to change the Schema itemtype and the decimal value from the average number (3 posts)

  1. jmuller777
    Posted 3 months ago #


    Please, can someone help me out on this? It should be simple, but searched a lot but i just cant find how to do these 2 things, so here it goes:

    First, How to change the schema itemtype from "article" to "aggregaterating"?


    Currently the %RATINGS_AVERAGE% is outputting a value like this: "4,00" and instead i would like it to be like this "4.00" - i need to have a point instead of the comma.

    Is there any parameter i can use to do that rather than hacking the plugin code?

    Thanks in advance!


  2. Lester Chan
    Plugin Author

    Posted 3 months ago #

    1. To change schema type, you need to use the latest dev version, https://github.com/lesterchan/wp-postratings/archive/master.zip

    add_filter('wp_postratings_schema_itemtype', 'wp_postratings_schema_itemtype');
    function wp_postratings_schema_itemtype($itemtype) {
    return 'itemscope itemtype="http://schema.org/AggregateRating"';

    2. There is no way around it without hacking the code. The code is using number_format_i18n() which takes the thousand separator from your language file.

  3. jmuller777
    Posted 3 months ago #

    Thanks a lot, the issue was fully solved!


You must log in to post.

About this Plugin

About this Topic