-1
我的代码:ACF(WordPress的)the_field不起作用
<p><?php the_field('myimage'); ?></p>
令牌来自:http://www.advancedcustomfields.com/resources/code-examples/
它显示什么。为什么?
我的代码:ACF(WordPress的)the_field不起作用
<p><?php the_field('myimage'); ?></p>
令牌来自:http://www.advancedcustomfields.com/resources/code-examples/
它显示什么。为什么?
如果您需要的<img>
标签的图像:
<img src="<?php the_field('myimage'); ?>" />
获取使用get_field自定义字段值。它返回值数组。要获取图片网址,请使用以下代码。
<?php $image = get_field('myimage'); ?>
<img src="<?php $image['url']; ?>" />
你能提供一个代码完成吗?它可能会帮助OP或未来的用户更多。 – Bono