title: WP Custom Fields, hide code if field is empty?
body: <p>I'm using a custom field template plugin for WP. I want to hide </p>
  
  <pre><code>&lt;li&gt;Sqft: [squareft]&lt;/li&gt; 
  </code></pre>
  
  <p>if the field is empty. I've tried different codes, these are two I've tried based on suggestions:</p>
  
  <pre><code>&lt;?php if ('squareft' !== '') { ?&gt;&lt;li&gt;Sqft: [squareft]&lt;/li&gt;  
  &lt;?php } ?&gt; 
  </code></pre>
  
  <p>And</p>
  
  <pre><code>&lt;?PHP $squareft = ('squareft'); if ($squareft != '') { echo '&lt;li&gt;Sqft: [squareft]
  &lt;/li&gt;';}  if (empty($squareft)) { echo " "; }  ?&gt;
  </code></pre>
  
  <p>I obviously don't have a clue what I'm doing, although I'm learning through trial and error. It uses shortcodes, so [squareft] is what to use to output the field data. </p>
  
  <p>Any help is appreciated.</p>
  
  <p>Update: 
  I think I've got it working, based on doing this method. Not yet gone live but it's working in my test post.</p>
  
  <pre><code>&lt;?php
  global $post;
  $bathrooms = get_post_meta($post-&gt;ID, 'bathrooms', true);
  if ( !empty($bathrooms) ) { echo '&lt;li&gt;Baths: [bathrooms]&lt;/li&gt; | ' ; }
  ?&gt;
  </code></pre>