function resimKontrol() {
$resim = get_post_meta($post->ID, "resim", true);
if(!empty($resim)) { return $resim; }
else { $resim = 'yeniresim.jpg'; return $resim; }
}
echo resimKontrol();Bu şekilde olabilir. WP'ye bu tarz şeyler yapmadım ama mantık olarak bu şekilde halledilebilir.