Been trying to google an answer but cant seem to find anything, I have the following...
<?php $values = array_map('trim', get_post_custom_values($key)); $value = implode($values,', '); echo "<div class='top-meta-vals'>".apply_filters(" $value\n", $value)."</div>"; ?>
I want to wrap each and every $value
in a span tag but im unsure how...
I tried,
<?php $value = "<span>".implode($values,', ')."</span>"; ?>
with no luck, can anybody give me an idea of where im going wrong?
In this way you are wrapping the entire set in one span, you have to add the closing/opening tag to the implode:
$value = "<span>".implode('</span>,<span>', $values)."</span>";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With