Sum and count of custom field values

I need to be able to sum up all values of a specific custom field and then get the total count.

For example, I have created a custom post type for reviews and each one has custom fields for 5 star rating.

What I need is to add up all the values of the star rating and divide by total count to give me the average.

Read more here: Sum and count of custom field values

Leave a Reply

Your email address will not be published. Required fields are marked *