Support

Account

Home Forums General Issues Comments field calculation

Helping

Comments field calculation

  • Hi,

    I have created custom fields for comments, and I am doing calculation for comments. It works well but for single comment. I would like to calculate all values from specific field for all comments.

    For example

    $number1 = get_field(‘number1’,$comment)
    $number2 = get_field(‘number2’,$comment)
    $number3 = $number1 + $number2

    I have this code and it does the calculation for single comment. Now I would like to get values for that fields from all comments for that post, and do the calculation like
    $number_total = $all_numbers / $number_of_fields

    Is that possible?

  • Hi,
    I’m looking for the same thing. Did you find a solution?

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.