wp query有幾筆資料 query many result

$query = new WP_Query( array( ‘cat’ => 5));
$num = $query->post_count;  //$num 可以秀出有幾筆