Creating a new custom field. How to only display <p></p> if custom field is added?

1 replies
Hi guys and gals. I need your help with something.

I've added a new custom field to my WordPress site:

<div class="time_stamp_amazon_post"> <p>Price as of: <?php echo get_post_meta(, 'time-stamp-amazon', true); ?> PST - Details</p> </div>
If I for example add the custom field time-stamp-amazon and give it the value 01/07/2015 14:11, it will display as Price as of: 01/07/2015 14:11 PST - Details on post's page. But if I decide to not add the custom field to a post, it will still display the content inside the <p></p>'s, which is Price as of: PST - Details.

How do I only display <p></p> if the actual custom field is added?



Thanks!

Jimmy
#<p>< or p> #added #creating #custom #display #field

Trending Topics