Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Wordpress自定义字段模板-显示特定键的文件字段中的多个图像_Php_Wordpress_Custom Fields - Fatal编程技术网

Php 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

我正在使用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
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.得到了解决方案,谢谢您的帮助