WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. jmuller777
    Member
    Posted 3 months ago #

    Hi,

    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"?

    And...

    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!

    https://wordpress.org/plugins/wp-postratings/

  2. Lester Chan
    Member
    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

    <?php
    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
    Member
    Posted 3 months ago #

    Thanks a lot, the issue was fully solved!

Reply

You must log in to post.

About this Plugin

About this Topic