Posted By

davebowker on 11/20/08


Tagged

wordpress field optional custom


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

nerdfiles
Filipsvk


Wordpress if custom field else


 / Published in: PHP
 

  1. <?php
  2. $number = get_post_meta($post->ID, 'number', true);
  3. if ( $number ) {
  4. echo 'there is a custom field value';
  5. }
  6. else {
  7. echo 'no custom field value';
  8. }
  9. ?>

Report this snippet  

You need to login to post a comment.