WP_Query has a property that returns the no of posts that match your query.
You can print it as follow in your first try:
$query = new WP_Query( $args );
echo $query->post_count;
WP_Query has a property that returns the no of posts that match your query.
You can print it as follow in your first try:
$query = new WP_Query( $args );
echo $query->post_count;