How to display a placeholder image if there's no image set up in WordPress? The picture is displayed by the $property_image var. It is a featured image from a custom post (not a WordPress original one).
It is defined by the code below, displays the featured image of the post if set up, if not, only shows the alt tag content ("Upcoming picture..."):
$property_image = dreamvilla_mp_get_device_image($property_ID);
Below my code from a WordPress theme:
$html .= '<div class="property-list-list property-listing-list-full">
<div class="col-xs-12 col-sm-4 col-md-4 property-list-list-image">
<a href=' . esc_url(get_permalink($property_ID)) . '>
<img '. $property_image . ' alt="Upcoming picture..." class="img-responsive">
</a>
' . $featured_proeprty_label . '
' . $featured_proeprty_label_icon . '
' . dreamvilla_mp_agent_favorites_property_icon($property_ID) . '
</div>
$property_imagevariable when there is image. and what its contain, when there isnt image? - Samvel Aleqsanyan