GraphicRiver

IF there is no custom field, how can I make it not show up?

505 posts
  • United States
  • Beta Tester
  • Won a Competition
  • Exclusive Author
  • Has been a member for 4-5 years
  • Sold between 100 and 1 000 dollars
  • Referred between 10 and 49 users
  • Bought between 10 and 49 items
SnedekerDesignz says

I have, for example, 3 custom fields (download, screenshots, trailer) but not all my posts have a trailer so I leave that blank, but how do I make it so it does not show up (trailer button)

thx

82 posts
  • Sold between 250 000 and 1 000 000 dollars
  • Elite Author
  • Has been a member for 5-6 years
  • Exclusive Author
  • Author had a File in an Envato Bundle
  • Referred between 200 and 499 users
  • Bought between 50 and 99 items
+2 more
mikemcalister says

Something like this should work. You have lots of WP questions, maybe you should hit up the WP forums for that kind of support.


<?php if ( get_post_meta($post?>ID, "trailer", true) ) { ?>
<p>Trailer:</p>
<?php echo get_post_meta($post?>ID, "trailer", true); ?>
<?php } ?>

505 posts
  • United States
  • Beta Tester
  • Won a Competition
  • Exclusive Author
  • Has been a member for 4-5 years
  • Sold between 100 and 1 000 dollars
  • Referred between 10 and 49 users
  • Bought between 10 and 49 items
SnedekerDesignz says

Ok thanks a lot! I’d sign up, but I was in a hurry and I hardly ever get forum activate emails.

by
by
by
by
by