Hi,
If we want to access custom values from custom fields which are not unique in wordpress post then get_post_custom_values() function are useful. Here I have described that how to use it…
This function returns an array containing all the values of the custom fields with a particular key $key of a post with ID $post_id.
Usage:
<?php get_post_custom_values($key, $post_id); ?>
Example:
<?php
$mykey_values = get_post_custom_values(‘my_key’);
foreach ( $mykey_values as $key => $value )
{
echo “$key => $value (‘my_key’)<br />”;
}
?>
Returns nothing if no such key exists, or none is entered.
Thanks,
Shane G.
Popularity: 6%