Opened 17 years ago
Closed 16 years ago
#6558 closed defect (bug) (invalid)
Searching Posts or Pages only with post_type is broken
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.5 |
Component: | General | Keywords: | post_type, search posts |
Focuses: | Cc: |
Description
As of version 2.5, Wordpress searches posts and pages by default. To search posts only, I was recommended to use a hidden field named "post_type" with a value of "post". I can confirm this does indeed *not* work. The variable "post_type" seems to be getting cleared at some point in the application. I've verified this through tests on a couple clean installs of version 2.5.
Change History (6)
#2
in reply to:
↑ 1
@
17 years ago
After further investigation, I retract my previous statement, as reported it is completely broken. I just didn't notice it gave me the front page again (made several test posts for things that happened to contain the search term, assumes everything was working).
Note: See
TracTickets for help on using
tickets.
I played around with this and found that something like: http://site/?post_type=post&?s=foo will work when searching for foo, it will only search posts, if they are the other way around it does not work (posts and pages are included in the search results). So I think that hidden field needs to come before the normal text entry field.