你应该把<img/> 标记和以下行中最后一个冒号后默认图像的所有必要内容:
$my_image = ( $image[0] != \'\' ) ? \' <img alt="\' . esc_attr( sprintf( the_title_attribute( \'echo=0\' ) ) ) . \'" title="\' . esc_attr( sprintf( the_title_attribute( \'echo=0\' ) ) ) . \'" class="tagim" src="\' . $image[0] . \'"/>\' : \'\';
 这句话的意思是
if 这个
$image[0] 变量为
not equal 至空白(
$image[0] != \'\'), 然后使用以下命令,然后提供图像标记
title, 这个
alt 和
src.  那么结肠后的部分基本上是
else.  所以如果
NOT BLANK 执行此操作
ELSE 这样做。你所拥有的其他东西基本上什么都没有。
那么试试这个,我们在ELSE部分添加一些东西:
$my_image = ( $image[0] != \'\' ) ? \' <img alt="\' . esc_attr( sprintf( the_title_attribute( \'echo=0\' ) ) ) . \'" title="\' . esc_attr( sprintf( the_title_attribute( \'echo=0\' ) ) ) . \'" class="tagim" src="\' . $image[0] . \'"/>\' : \' <img alt="\' . esc_attr( sprintf( the_title_attribute( \'echo=0\' ) ) ) . \'" title="\' . esc_attr( sprintf( the_title_attribute( \'echo=0\' ) ) ) . \'" class="tagim" src="theurlforyourdefaultimage.com/imagename.png"/>\';
 您需要提供默认图像的URL。不确定它是否在你的主题文件夹中,或者你上传的东西中,但目前你可以使用完整的URL进行测试。
我想也要确定你是否还想要同样的alt 和title 即使存在默认图像而不是特征图像,或者您希望它们也是通用的。