[wp-trac] [WordPress Trac] #18614: post_type_archive_title doesn't work when tax_query is added to wp_query

WordPress Trac wp-trac at lists.automattic.com
Wed Sep 7 18:56:21 UTC 2011


#18614: post_type_archive_title doesn't work when tax_query is added to wp_query
----------------------------+----------------------
 Reporter:  wonderboymusic  |       Owner:
     Type:  defect (bug)    |      Status:  closed
 Priority:  normal          |   Milestone:
Component:  Template        |     Version:  3.3
 Severity:  normal          |  Resolution:  wontfix
 Keywords:  has-patch       |
----------------------------+----------------------
Changes (by scribu):

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


Comment:

 What about when you are on a taxonomy page and use 'pre_get_posts' to set
 an author etc. etc.? We can't apply band-aids like this.

 As a workaround for your problem, you can reset
 {{{$wp_query->queried_object}}} to {{{get_post_type_object(
 get_post_type() );}}} so that post_type_archive_title() gets the correct
 thing when it calls get_queried_object().

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


More information about the wp-trac mailing list