I was going to say I had the same problem, but then I noticed I didn’t have Relevanssi activated on my test blog. Once I activated the plugin, the problem went away and everything works like it should.
Now, that raises the question: are you sure your search results are provided by Relevanssi? Because the way Relevanssi is coupled with WordPress is a bit fragile, it can be thrown off by something small like a single query_posts() call on the search results page.
I looked in my search results page and found no reference to query_posts(). I checked my results with Relevanssi deactivated and my search results are in a different order (by date). Activated Relevanssi again, and my search results changed. It seems strange that I can set my post_type to post or event, and my search results get filtered perfectly, but once I set it to page, everything comes back.
Thanks for responding, I do believe that Relevanssi is returning my search results, is there anywhere else I should be checking?
Thanks again.
That’s a strange thing… Sorry, I don’t have any more ideas. Maybe you could put a
var_dump($wp_query);
somewhere on your search results page to see if the post_type parameter is passed correctly.
Oops, looks like I’m having the same problem as well.
I’ll see what’s going on. Meanwhile, I can give you a quick fix: use post_types
instead of post_type
. That one works for me.
Looks like trying to set the post_type
to “page” makes WordPress set it to “any”. This is some sort of WordPress trickery that Relevanssi can’t do anything about – since WP changes the value, Relevanssi can’t tell when the user really means “any” or not. I don’t think this has happened before, so it might be a new feature of 3.3.
Anyway, this is a WP feature that can’t be fixed in Relevanssi, so you need to use the post_types
query variable to circumvent this. That one is introduced by Relevanssi and won’t be touched by WP.
Using the post_types fixed my problem. Sorry I’m getting back to you so late. Thanks for the quick response.