I wonder if you mean this kind of loop:
$total_views = 0;
$post_ids = [2, 3, 7, 53, 75];
foreach( $post_ids as $post_id )
{
$total_views += (int) get_post_meta( $post_id, 'post_views', true );
}
to calculate the total sum.
I wonder if you mean this kind of loop:
$total_views = 0;
$post_ids = [2, 3, 7, 53, 75];
foreach( $post_ids as $post_id )
{
$total_views += (int) get_post_meta( $post_id, 'post_views', true );
}
to calculate the total sum.