Reputation: 47
wp_reset_postdata
and wp_reset_query
restores global $post variable.
How do I reset $paged variable which is used in pagination?
OR
How can I get back to www.example.com/page/1 from any page like www.example.com/page/32?
Upvotes: 1
Views: 1977
Reputation: 236
I do this on my site by doing this
$wp_query->set('paged', 1);
where $wp_query is your WP_Query object you're querying. You would do this AFTER you defined $wp_query in your code.
Upvotes: 3