List custom field values in alphabetical order without repetition from the current category?
what you could do is: 1. get the list of all posts currently on the page 2. grab all the IDs of the posts 3. do the following query: SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key = ‘product_brand’ AND post_id IN (3,9,10,15) ORDER BY meta_value; where 3,9,10,15 are post ids that you’ve collected.