WordPress.org

Forums

Average of a posts meta (1 post)

  1. wamslers
    Member
    Posted 1 year ago #

    Hi,

    How can I get the average of a posts meta?

    I searching around the net - but with no useful result. Maybe the help is here?! Please give me some links or a answer of my problem, if you have.

    Here is my query:

    $average_args = array(
              'post_type' => 'post' ,
              'post_status' => 'publish' ,
              'cat' => 129 ,
              'meta_key' => rating' ,
              'meta_value' => ''
    );
    
    $get_average = new WP_Query( $average_args );
    //$average = $get_average->post_count;

    Thanks :)

Topic Closed

This topic has been closed to new replies.

About this Topic