I have a custom field who's content I would like to output as a ul list.
The custom field contains words that are separated with spaces.
I'm trying to use this code here but it's not working.
<?php
$list_items = get_post_meta($post->ID, 'idid');
if($list_items){
$list_items = explode(" ", $list_items) {
echo '<ul>';
foreach($list_items as $list_item)
echo '<li>' . $list_item . '</li>';
echo '</ul>';
}
}
?>
;
before explode function, and remove accolades.$list_items
where to put result of explode.Your code will look like: