How to know how many post return a query?

Question

I have this query :

$the_query = new WP_Query(query_posts( array(
        'post_type' => 'post',
        'posts_per_page' => 3,
        'meta_query' => array(
            array(
                'key' => '_end_actu_date',
                'value' => date( 'Y-m-d' ),
                'compare' => '>=',
                'type' => 'DATE'
            )
        )
    ) )
    );

I have max three posts. But I would like to write display conditions if I have one post or two posts. How can I know how many post the query returning ?

Thanks for answer.

0
Gpi 10 months 2022-08-25T09:33:17-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse