I’m using Verve Meta Boxes. I want to make a menu out of one of the custom fields. How can I return all of the custom field values? For example, if I had a custom select field called “fruit” and as options I have “apples”, “oranges”, and “bananas”, how could I get a complete list of those values, as an array perhaps? I can get the ones associated with a post:
get_post_custom_values('fruit')
â¦but I can’t work out how to get the whole list.
Thank you in advance!
In case someone still wondering:
Just make sure your postmeta table is “wp_postmeta” (default) and change FIELD_NAME with the name you created for the field in the admin.
You could do it the regular wordpress way by using the get_post_meta function in your loop.
Try this one out:
Basically you need to separate your fruits name with comma in your custom field so that you will be able to explode them into array and echo the values one by one.
Thanks,Dave
I wasn’t able to find an elegant solution. What I ended up doing was loop through all of the posts and kept a record of unique values as I can across them, creating an array. Then I used that array to make my navigation.