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?
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?
Comments are closed.
I do this on my site by doing this
where $wp_query is your WP_Query object you’re querying. You would do this AFTER you defined $wp_query in your code.