I have a little issue and need your help.
I’m trying to create a dropdown menu from all the values of a custom field. For example I have a custom post type ‘locations’ with custom field ‘country’. I want to take all the countries and put them into a <select>.
I succeeded to get all countries but if I have one country used in more that one location it shows twice or more. How can I distinct the results? I managed to do it with jQuery but I don’t think it’s the right way.
Here is the code that I use to get the fields: