php - How can I search my database, in WordPress, for all the options of a custom field? -
i'm in custom taxonomy page , need display options of particular custom field called "region". tried doing database query possible values, because multiple regions selectable in custom field, resulted values many different combinations of regions (such "asia, africa, europe" one, "central america, north america" , "europe, central america", etc etc.)
i want retrieve them singularly, ("asia" one, "europe" another, etc. etc.) how go doing this?
you can use basic coding approach of php.
approach:
use explode() function of php , set values in array each meta value key 'coffee_region' (adding each meta value in single array. make sure adding elements not overwriting previous values of meta in array).
then use array_unique() function rid of repetitive countries array.
and when print array having listing of unique country names meta fields
Comments
Post a Comment