Custom Field – standard text instead when no content
-
I use this line to display a custom field (photograoher) on single.php…
<?php $key="photographer"; echo get_post_meta($post->ID, $key, true); ?>
Say the custom field “photographer” has not been added to a specific post. Is there anyway to just display a standard text then – “Not known” or something like that?
Regards,
Anders
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Custom Field – standard text instead when no content’ is closed to new replies.