[wp-trac] [WordPress Trac] #21009: If name="post_type" is set in search template the archive template is loaded.

WordPress Trac wp-trac at lists.automattic.com
Wed Sep 26 21:12:58 UTC 2012


#21009: If name="post_type" is set in search template the archive template is
loaded.
-------------------------------+------------------------------
 Reporter:  ZaneMatthew        |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Post Types         |     Version:  3.4
 Severity:  minor              |  Resolution:
 Keywords:  reporter-feedback  |
-------------------------------+------------------------------

Comment (by WraithKenny):

 I've duplicated this. I think is has to do with a conflict here:
 {{{
 ...
 'rewrite' => array('slug' => 'recipes'),
 'query_var' => true,
 'has_archive' => true,
 ...
 }}}
 where the archive rewrite trumps the search.

 www.example.com/?post_type=recipes goes to the archive like it's supposed
 to, and www.example.com/?s=meat goes to search, but
 www.example.com/?s=meat&post_type=recipes loads up the archive.

 It's probably the 'query_var' doing it right? I agree with Nacin about `s`
 trumping the 'query_var'.

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


More information about the wp-trac mailing list