• Is it possible to return multiple custom fields that have the same key (from the same post) within the Loop?
    I’ve tried Coffee2Code’s plugin, but it doesn’t seem to have this ability. Am I incorrect, or is there another way of doing this?
    Many thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Simplest way is to add this to your template (in The Loop:

    <?php foreach(get_post_custom_values('key') as $value) : ?>

    ~ This displays on each occurence of the custom field key ‘key’ — to output the value: <?php echo $value; ?>

    <?php endforeach; ?>

    Thread Starter isermesh

    (@isermesh)

    Thanks! This works splendidly.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Return multiple custom fields of same key for same post?’ is closed to new replies.