Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

There are tutorials that explain how to limit a search to a specific category.

My question is, is there a way to configure wordpress' search to, within a custom post type, search for a custom field value.

So for example, if I search for "hello", the results would come up with posts that have a certain custom field equal to "hello". The certain post would also be a certain custom post type.

Any help is appreciated.

share|improve this question
    
You can try building a custom search. –  Rutwick Gangurde Aug 10 '11 at 6:42

1 Answer 1

Have you tried adding this hidden field to the search form?

<input type="hidden" name="post_type" value="news" /> 

For value="", you should include the name of your custom post type, of course.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.