Stars

  • Hola.
    How to make a fractional rating? When editing a snippet (selected service), only 2 values:
    Rating value
    Rating amount
    I do not need Rating: 5 – 555 votes
    It is necessary that the rating was “human” :), example: 4.9 – 216 votes

    • This topic was modified 11 months, 4 weeks ago by Alter Ego.
    • This topic was modified 11 months, 4 weeks ago by Alter Ego.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    This feature is hardcoded to the UI but you can workaround this by adding the following code to your theme’s functions.php file:

    add_filter('rank_math/snippet/rich_snippet_service_entity', function( $entity ) {
    	
    	$entity['aggregateRating']['ratingValue'] = '4.9';
    	return $entity;
    });

    Looking forward to helping you. Thank you.

    ​​​​​​​

    And if need a rating from 4 to 5, then in such a way to register code?

    add_filter('rank_math/snippet/rich_snippet_service_entity', function( $entity ) {
    	
    	$entity['aggregateRating']['ratingValue'] = '4.1';
    	$entity['aggregateRating']['ratingValue'] = '4.2';
    	$entity['aggregateRating']['ratingValue'] = '4.3';
    	$entity['aggregateRating']['ratingValue'] = '4.4';
    	$entity['aggregateRating']['ratingValue'] = '4.5';
    	$entity['aggregateRating']['ratingValue'] = '4.6';
    	$entity['aggregateRating']['ratingValue'] = '4.7';
    	$entity['aggregateRating']['ratingValue'] = '4.8';
    	$entity['aggregateRating']['ratingValue'] = '4.9';
    	return $entity;
    });

    Hello,

    We already gave you the code for that.

    Moreover, 4.1 etc. ratings are mostly where there are multiple ratings. With Rank Math, only one person is going to leave a rating. So, it could be 4 out of 5 or 5 out of 5.

    We do not have an aggregate rating system (except in WooCommerce where that is done automatically) so it doesn’t make sense to allow fractional rating.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Added code in functions.php. I tried to edit the old page and create a new page. But it does not work. The rating also remained 4 or 5.

    https://www.dropbox.com/s/yekidus1iq096i3/nw.jpg?dl=0

    • This reply was modified 11 months, 2 weeks ago by Alter Ego.

    Hello,

    Thank you for contacting Rank Math today.

    Would you mind sharing some temporary admin access on the sensitive data section along with a link to the affected page so that we can check this for you?

    Looking forward to helping you. Thank you.

    ​​​​​​

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)

The ticket ‘Stars’ is closed to new replies.