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>
So far, here is what I have been able to do.
<select>
<option value="" selected="selected">Please pick a city below...</option>
<option value="<?php echo get_post_meta($post->ID, 'City', true) ?>">
<?php echo get_post_meta($post->ID, 'City', true) ?>
</option>
</select>
Not much, I know. Any help, please ? Thank you in advance.