[wp-trac] [WordPress Trac] #11461: When creating a new WP_Query, running the_post() on the new object resets global $post

WordPress Trac wp-trac at lists.automattic.com
Wed Dec 16 21:56:20 UTC 2009


#11461: When creating a new WP_Query, running the_post() on the new object resets
global $post
--------------------------+-------------------------------------------------
 Reporter:  bsdeluxe      |        Owner:  ryan      
     Type:  defect (bug)  |       Status:  closed    
 Priority:  normal        |    Milestone:            
Component:  Query         |      Version:            
 Severity:  normal        |   Resolution:  worksforme
 Keywords:                |  
--------------------------+-------------------------------------------------
Changes (by scribu):

  * keywords:  close =>
  * status:  new => closed
  * resolution:  => worksforme
  * milestone:  Unassigned =>


Comment:

 Replying to [comment:4 dd32]:
 > call {{{wp_reset_query()}}} after your custom loop to reset it back to
 the main loop.

 There you go.

 Reopen when we drop PHP 4 for good.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11461#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list