Q: PHP code for displaying alternate image if custom field is not populated I am trying to display what might be called a placeholder image if an image custom field has not been provided
I've got this far but am a bit stuck. The output is showing the code. Here is the PHP I am using.
$my_image = get_post_meta($post->ID, 'ecpt_images', true);

if( isset($my_image) && $my_image != '') {
    echo '<img src="'.$my_image.'" width="230px" height="175px" />';
} else { 
    echo '<img src="/wp-content/uploads/2013/02/Poor.png">';
}

Thank you very much in advance

A: Check if you used short open tag <? /* your code */ ?>. This setting is by default disabled and not recommended. Make sure you wrapped your code properly within <?php /* your code */ ?>.
