• Hi, I added a custom field (location) for some posts. They are from different categories. On the category archive page, I want to display a dropdown list with all the locations (England, Germany, Greece) that are from the same category as the archive page. Is this possible? I am using the following code to get all the locations:

    $places = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT meta_value FROM 
      $wpdb->postmeta WHERE meta_key = %s ORDER BY meta_value ASC", $metakey) );

    However, what i need to do is to restrict the mata values by post category, e.g. concerts, events, etc. Is this even possible?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Get All Custom Field Values from a specific key and from a specific category’ is closed to new replies.