title: Wordpress - output custom field as ul list
body: <p>I have a custom field who's content I would like to output as a ul list.</p>
  
  <p>The custom field contains words that are separated with spaces.</p>
  
  <p>I'm trying to use this code here but it's not working.</p>
  
  <pre><code>    &lt;?php
      $list_items = get_post_meta($post-&gt;ID, 'idid');
  
           if($list_items){
              $list_items = explode(" ", $list_items) {
                  echo '&lt;ul&gt;';
                      foreach($list_items as $list_item)
                          echo '&lt;li&gt;' . $list_item . '&lt;/li&gt;';
                  echo '&lt;/ul&gt;';
              }
          }
  
      ?&gt;
  </code></pre>