[wp-hackers] Select Menu to filter results by Custom Values

Kelter-BadCat Design kelter at badcat.com
Fri Nov 21 15:51:06 GMT 2008


I sent this out before but no one answered so I guess it's taboo  ;-)

Anyone? Please?


I'm trying to get WordPress to return a dropdown 
list (a SELECT MENU - similar to how we use 
"wp_dropdown_categories") of VALUES for a 
particular custom KEY that I've entered in the 
Custom Field.

I'd like to use this dropdown list as a way to 
filter the results (a listing of posts) shown on 
the page.

I tried approaching it like thisŠ

< ?php echo get_post_meta($post->ID, 'time', $single = true); ? >


< ?php $key="time"; echo get_post_meta($post->ID, $time, $single = false); ? >

Whereas "time" is the Custom KEY. Additionally I 
need the VALUES in a Select Menu so I can run the 
filter via a form element.

Can anyone point me to any examples or possibly 
something on the WP Codex? Seems like all 
functions try to point me to "Post specific" 


More information about the wp-hackers mailing list