From 4179e52a2b25c5eaec578020c0bf49ecc170546f Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 25 Jan 2008 01:41:57 +0000 Subject: [PATCH] Restore global post when resetting the query. Props ionfish. fixes #5439 git-svn-id: https://develop.svn.wordpress.org/trunk@6653 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 321ee22c8d..02d96bec12 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -27,7 +27,7 @@ function wp_reset_query() { $GLOBALS['wp_query'] =& $GLOBALS['wp_the_query']; global $wp_query; if ( !empty($wp_query->post) ) { - $GLOBALS['post'] = $wp_query->post; + $GLOBALS['post'] = $wp_query->next_post(); setup_postdata($wp_query->post); } }