Sum and count of custom field values
Thanks for your help guys. They didn’t quit work exactly, but I managed to get the result I needed by doing the following $reviewsNum = 0; $reviewsCount = 0; $argsSchema = array( ‘post_type’ => ‘reviews’, ‘posts_per_page’ => -1 ); $loopSchema = new WP_Query( $argsSchema ); $count_reviews = wp_count_posts( ‘reviews’ )->publish; while ( $loopSchema->have_posts() ) : … Read more