Posted By

i-am-andy on 10/28/11


wordpress conditional field statement custom

Versions (?)

Conditional Statement if Custom Field Exists Wordpress

 / Published in: PHP

Only show content if Custom Field exists

  1. <?php if (strlen(get_post_meta($post->ID, "direct dial", true)) > 0) : ?>
  2. <p class="direct_dial"><strong>DD</strong> <?php echo get_post_meta($post->ID, "direct dial", true);?></p>
  3. <?php endif; ?>

Report this snippet  

You need to login to post a comment.