isermesh
Member
Posted 6 years ago #
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.
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; ?>
isermesh
Member
Posted 6 years ago #
Thanks! This works splendidly.