help with querying custom fields value options
-
Hi, im looking to build both an archive/view of a content type filtered by a custom field, a la
Content Type: Resource
Custom Field: PDF, PPT, Image, etc.my custom field is set up as a single select, and I want to query the DB to return all of the pre-set options. How would I do this?
I have the following:
$values = $wpdb->get_col(“SELECT meta_value FROM $wpdb->postmeta WHERE meta_key = ‘resourcetype'” );but I know I need to change meta_value to something else, or perhaps this query is way off?
Also, after I do this, is the best way to build this archive/fliltered view is to create a new page, assign a new tpl to it, and in that template, have my query filter on a #hash value I pass into the URL?
Curious as to how others have done this?
Thanks for any help!
- The topic ‘help with querying custom fields value options’ is closed to new replies.