1
我正在开发一个wordpress主题并使用自定义字段。我有以下代码:get_post_meta在img src返回src
<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))); ?>
任何想法为什么图像显示不正确?