Skip Navigation

[Resolved] Total + average rating

This support ticket is created 3 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 1 reply, has 2 voices.

Last updated by Jamal 3 years ago.

Assisted by: Jamal.

Author
Posts
#2024749

I've 2 custom posts:
- reviews
- service

There's a child-parent relationship.

Each service (parent) can display several reviews (child).

Among the custom fields, there's "rating" (number). Between 1 and 5.

For each service, I would like to show:
- total number of reviews,
- average of the ratings.

I also would like to use that for Rankmath, who has a module for schema & ratings. If not possible, then bypass Rankmath to produce a code to use schema.

Thank you for your help

#2024963

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and thank you for contacting the Toolset support.

Toolset does not offer a built-in way to calculate sums and averages. You will need custom code to implement it. Either by using a custom shortcode inside the view or by producing a shortcode that uses the relationships API to get the child posts and calculate the results for them.

Please note that custom code is beyond the scope of the support forum. If you are not comfortable with programming, consider hiring a developer. This is the list of our partners https://toolset.com/contractors/
https://toolset.com/toolset-support-policy/

Check these previous similar threads for inspiration:
- https://toolset.com/forums/topic/is-there-any-way-to-calculate-sum-of-values-of-prticular-field-in-picked-items/#post-1310705
- https://toolset.com/forums/topic/sum-of-custom-fields-calculation/#post-1568815
- https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.