Skip to main content

Given the following example of a custom query

$query = new WP_Query(array(
 
        'posts_per_page' => 7,
        'categor_name' => 'events',
        'offset' => 5
        ));

));

Does the order of arguments matter?

Will this query first select all posts with the given category and then offset the first 5 or will it first offset all 5 posts then select posts with given category?

Given the following example of a custom query

$query = new WP_Query(array(
 
        'posts_per_page' => 7,
        'categor_name' => 'events',
        'offset' => 5
        

));

Does the order of arguments matter?

Will this query first select all posts with the given category and then offset the first 5 or will it first offset all 5 posts then select posts with given category?

Given the following example of a custom query

$query = new WP_Query(array(
    'posts_per_page' => 7,
    'categor_name' => 'events',
    'offset' => 5
));

Does the order of arguments matter?

Will this query first select all posts with the given category and then offset the first 5 or will it first offset all 5 posts then select posts with given category?

Source Link
user176147
user176147

WP_Query arguments order

Given the following example of a custom query

$query = new WP_Query(array(

        'posts_per_page' => 7,
        'categor_name' => 'events',
        'offset' => 5
        

));

Does the order of arguments matter?

Will this query first select all posts with the given category and then offset the first 5 or will it first offset all 5 posts then select posts with given category?