【发布时间】:2012-01-05 08:29:59
【问题描述】:
我正在开发一个 wordpress 主题并使用自定义字段。我有以下代码:
<img alt="sunset" src="<?php echo get_post_meta($post_id->ID, 'bottom', true) ?>" height="150" width="450" border="0" />
// That code is giving this:
<img alt="sunset" src="" height="150" width="450" border="0">
我使用此代码检查自定义字段是否为空,它返回正确的图像路径,使用该路径查看图像时正常工作。
<?php exit ( var_dump( get_post_meta($post->ID, 'bottom', true) ) ); ?>
关于为什么图像无法正确显示的任何想法?
【问题讨论】: