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

Kelter-BadCat Design kelter at badcat.com
Fri Nov 21 21:32:16 GMT 2008

Thanks Jennifer,

I've been to these pages already -

I seem to get just text returned back stating "Array" when using:
<?php echo get_post_meta($post->ID, 'time', $single = false); ?>

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

It "works" but then I only get the data from the first post delivered 
to the page.

I've even tried variants of...
<?php $key="time"; echo get_post_meta($post->ID, $time, $single = true); ?>
to no avail.

The next step of getting this returned into a select menu also fails.


At 11:42 AM -0800 11/21/08, Jennifer Hodgdon wrote:
>scribu wrote:
>>Also, you'll have to use a custom query, something like " SELECT * FROM
>>$wpdb->postmeta WHERE key='time' "
>I don't think that is necessary. The get_post_meta() function should 
>return the whole array, and get_post_custom gives you all the post 
>meta in one big array.
>    --Jennifer
>Jennifer Hodgdon * Poplar ProductivityWare
>Drupal/WordPress Sites, Themes, Modules/Plugins
>Custom Web Programming, Web Databases
>PHP, Perl, MySQL, JavaScript, XML, AJAX

More information about the wp-hackers mailing list