Posted By

alexeihidalgo on 04/04/11


Tagged

wordpress


Versions (?)

Show custom field only if populated Wordpress


 / Published in: PHP
 

  1. <?php $FIELDNAME = get_post_meta($post->ID, 'FIELDNAME', true);
  2.  
  3. if($FIELDNAME) : ?>
  4.  
  5. <a title="Click Here To Purchase Tickets" href="<?php get_custom_field_value('FIELDNAME', true) ?>" rel="bookmark">PURCHASE TIX</a>
  6.  
  7. <?php endif; ?>

Report this snippet  

You need to login to post a comment.