It may be more of a php question but is there a way we can change comma separated values from a custom field entries like
apples, oranges, bannanas
to
<li>apples</li>
<li>oranges</li>
<li>bannanas</li>
Any help is much appreciated.
It may be more of a php question but is there a way we can change comma separated values from a custom field entries like
apples, oranges, bannanas
to
<li>apples</li>
<li>oranges</li>
<li>bannanas</li>
Any help is much appreciated.
<?php
$string = get_post_meta($post->postID, 'CustomFieldName', true);
$values = explode(',', $string);
foreach ($values as $value) {
echo '<li>' . $value . "</li>\n";
}
?>This topic has been closed to new replies.