/ Published in: PHP
Good for showing labels/descriptions that accompany custom fields when they are set, and avoiding lots of empty labels.
Eg: if there is no content set in the 'project-agency' field, don't show the label 'Agency:', but if there is, show it with the content.
Eg: if there is no content set in the 'project-agency' field, don't show the label 'Agency:', but if there is, show it with the content.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $themeta = get_post_meta($post->ID, 'project-agency', TRUE); ?> <strong>Agency:</strong> <?php echo get_post_meta($post->ID, 'project-agency', true); ?> <? endif; ?>