Increment paged on WP_Query

What’s the proper way to increment ‘paged’ under a WP_Query call? This is what I have below:

$custom_query = new WP_Query([
‘post_type’ => ’employee’,
‘post_status’ => ‘any’,
‘posts_per_page’ => 10,
‘paged’ => 1,
]);

foreach ($custom_query->posts as $employee) {
var_dump($employee);
}

var_dump($employee) returns my first 10 records, but I can’t figure out how to increment or target ‘paged’.

I’ve tried doing $custom_query[‘paged’]++; but can’t seem to get it to work.

Read more here:: Increment paged on WP_Query

Leave a Reply

Your email address will not be published. Required fields are marked *