I want to retrieve a specific post_meta of all posts contained in a specific category. I want to build a search form at the top of each category with a select field which would be filled up by the required post_meta of all the post contained in the category the user is currently in. Is this doable?
Maybe it's possible with a loop which would look like:

For each post_meta called "City" in all posts contained in category 'X',
you must put it in <option value="City's name">City's name</option>

3 Answers
3

I sounds like your doing this wrong. You do not typically query the post meta first in a hierarchical query since it will be much slower. I don't really know how your structuring this by your question.

The logic should be -->query category--->query posts with meta value ( or tag or sub-category, don't forget these work to).

Please check the answer I posted, especially the link to the article "Enhancing WordPress Custom Fields with Search Filtering". That is what I meant to do. I'm sorry if my explanation wasn't clear.
–
MacximJul 20 '11 at 11:03