title: Show/hide HTML element when custom field is empty
body: <p>I have custom fields on the page which are gathered from the user input on the form. Every time there will be inserted ONLY ONE (<code>customfield1</code> and <code>customfield2</code>). I don't know how to hide the whole <code>div</code> (class="customfield") if the <code>customfield1</code> or <code>customfield2</code> is empty. I cannot change <code>customfield</code> to different class or id.</p>
  
  <p>Thank you very much!</p>
  
  <pre><code>&lt;div class="customfield"&gt;
      &lt;h4&gt;Custom field title 1&lt;/h4&gt;
      &lt;?php if( get_post_meta($post-&gt;ID, "customfield1", true) ): ?&gt;
      &lt;?php echo get_post_meta($post-&gt;ID, "customfield1", true); ?&gt;
      &lt;?php endif; ?&gt;                     
  &lt;/div&gt;
  
  &lt;div class="customfield"&gt;
      &lt;h4&gt;Custom field title 2&lt;/h4&gt;
      &lt;?php if( get_post_meta($post-&gt;ID, "customfield2", true) ): ?&gt;
      &lt;?php echo get_post_meta($post-&gt;ID, "customfield2", true); ?&gt;
      &lt;?php endif; ?&gt;                     
  &lt;/div&gt;
  </code></pre>