Php Wordpress自定义字段模板-显示特定键的文件字段中的多个图像
我正在使用Wordpress自定义字段模板插件- 我创建了一些像这样的文件Php Wordpress自定义字段模板-显示特定键的文件字段中的多个图像,php,wordpress,custom-fields,Php,Wordpress,Custom Fields,我正在使用Wordpress自定义字段模板插件- 我创建了一些像这样的文件 [slideshow] type = file relation = true label = Images For the Slide show? [slideshow] type = file relation = true hideKey = true [slideshow] type = file relation = true hideKey = true [slideshow] type = file
[slideshow]
type = file
relation = true
label = Images For the Slide show?
[slideshow]
type = file
relation = true
hideKey = true
[slideshow]
type = file
relation = true
hideKey = true
[slideshow]
type = file
relation = true
hideKey = true
我想显示文件字段中的图像列表,比如
<?php $slide_images = get_post_meta($post->ID, 'slideshow', false); ?>
<ul id="slideshow">
<?php foreach($slide_images as $slide_image) {
echo '<li>'.$slide_image.'</li>';
} ?>
<ul>
参考:
找到解决方案了吗
<?php $slide_images = get_post_meta($post->ID, 'slideshow', false); ?>
<ul id="slideshow">
<?php foreach($slide_images as $key=>$slide_image) {
$slide_url = wp_get_attachment_image($slide_image, 'full');
echo '<li>'.$slide_url.'</li>';
} ?>
你被卡在哪里了,哪里出错了?现在没有错误,只打印图像ID,我想获取图像
wp\u get\u attachment\u url(“图像ID”,“完整”)代码>如果是这样,您可以使用wp_get_attachment_url($slide_image,'full');我制作了类似这样的东西,而不仅仅是$slide\u image.得到了解决方案,谢谢您的帮助