Return to Snippet

Revision: 49862
at August 1, 2011 05:05 by wahnbriefe


Initial Code
<?php
$themeta = get_post_meta($post->ID, 'project-agency', TRUE);
if(!empty($themeta)):
?>

<strong>Agency:</strong> <?php echo get_post_meta($post->ID, 'project-agency', true); ?>

<?
endif;
?>

Initial URL


Initial Description
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.

Initial Title
If custom field has content

Initial Tags
wordpress

Initial Language
PHP