[wp-trac] [WordPress Trac] #20647: get_post_type() returns nothing on custom post type archive pages with custom query and no results

WordPress Trac wp-trac at lists.automattic.com
Wed May 9 22:18:37 UTC 2012


#20647: get_post_type() returns nothing on custom post type archive pages with
custom query and no results
-----------------------------+------------------------------
 Reporter:  MikevHoenselaar  |       Owner:  MikevHoenselaar
     Type:  defect (bug)     |      Status:  closed
 Priority:  normal           |   Milestone:
Component:  Post Types       |     Version:  3.3.2
 Severity:  normal           |  Resolution:  invalid
 Keywords:  needs-patch      |
-----------------------------+------------------------------
Changes (by scribu):

 * status:  new => closed
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 If you're using query_posts() and it whipes out the $post global, the
 solution isn't to patch get_post_type(), but to call wp_reset_query() or
 wp_reset_postdata().

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


More information about the wp-trac mailing list