2013-12-23 57 views
0

我有以下的PHP变量

if (has_post_thumbnail($post->ID)): $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'single-post-thumbnail'); 

其中I输出在WordPress模板如下:

<img src="<?php echo $image[0]; ?>" /> 

然而,我现在必须输出它在以下格式:

$html .= '<img src="'.image().'" />'; 

(和一些更多$ html行)。如何实现此pro佩尔利?

+2

那么什么又是什么问题?你好像现在想要使用'image()'函数? – JakeGould

回答

2

尝试,

$html .= '<img src="'.$image[0].'" />'; 

(我希望我没有误解这里的问题)

+0

我实际上会说同样的事情,但目前还不清楚问题是什么。 – JakeGould

+0

只是一个建议,将其改为'$ html。='';' - 不妨同时修复验证错误。 – yitwail

+0

我不明白 - 因为我试了一百次没有成功,我以为我做错了什么。不过,它似乎刚刚起作用。感谢您的提升。 –

相关问题