If custom field is empty show a default image
Does anybody knows if there is a code, that i can use in the template pages, that reads the custom field to show the image and, if the custom field is empty, show a default image?
Today I use:
<img src=”<?php $values = get_post_custom_values(“ImageDestaque”); echo $values; ?>” alt=”” style=”border:#000000 1px solid” />
I would like to show a “/blank.gif” in case of an empty custom field “ImageDestaque”
- The topic ‘If custom field is empty show a default image’ is closed to new replies.