How can i get count from query post

How can i get the row counts in query post like mysql count(*).

$obj_name = new WP_Query($args);

while ($obj_name->have_posts()) : $obj_name->the_post(); 

// here i want to predict looping counts

endwhile;

How can i do this.

3

$num = $obj_name->post_count; 

Reference: wp_query

Leave a Comment