21/05/03 20:55:59.41 N1nfC+z1r.net
>>11
原因は>return $first_img; の前に処理が続いてるのにreturnしているからとヤフー知恵袋で教えてもらいましたが、
<php if(empty($first_img)){ //Defines a default image
$first_img = "/images/default.jpg";
}
return $first_img;
の部分は後から別のコードを連結したためおかしくなってます。
本来は
<php if(empty($first_img)){ //Defines a default image
$first_img = "/images/default.jpg";
}
return $first_img;
}
で処理を閉じるのですが。
続きのコードまで処理が続いているため、<php endif; ?>がいらないとエラーが出ます。
仮の画像につなぐコードを維持しつつ<php endif; ?>につなぐには<span class="thumbnail2">
<img class="heit6" src="<php echo esc_attr( $first_img ); ?>" alt="" />
</span>
<php endif; ?>を書き換える必要があるのでしょうか?