Get Post Count Of WP_Query

$the_query_new = new WP_Query(array('post_type' => 'grade', 'assignment' => $theassignmentID));
$points3 = $the_query_new->found_posts;

create a new wp_query, then do

$wp_query_variable->found_posts

That will give you the number of posts that the wp_query finds.

Advertisements