I would like to create a custom search form to search posts based on the values of about 4 custom fields. I tried using wp_query to achieve this but so far my biggest problem is that the I don't get any results when searching for data in custom fields - even for data that I am sure exists. Also, I can't figure out how to remove the normal WordPress "keyword" search box and use just my four combo boxes.

Someone down voted this and I'd really like to know why, since this is something I use on a regular basis. If you care to explain, I appreciate it. :)
–
moraleidaJun 9 '12 at 13:26

Hi Moraleida, thanks for the answer. I'll surely try it out. I don't know who down-voted the answer, but I can't even vote because my reputation is low as a newbie here. I'll try out the code that you've suggested. My search form has 5 drop-down fields with values for those 5 custom fields. Should I just use the form as-is, with you code above?
–
3phJun 9 '12 at 15:33

I wasn't talking about you @3ph, not to worry :).
–
moraleidaJun 9 '12 at 16:08

About the code usage, it depends on what really you need to achieve. Try it out with one custom field as is. If it works, then just add another 4 of the array('key' => 'field_to_seach', 'value' => $thesearch, 'compare' => 'IN') parts. Drop in if you need more help.
–
moraleidaJun 9 '12 at 16:12