我有一个用于上传图像的post meta,最多允许5个文件。
数据存储如下:
a:5:{i:0;s:3:"694";i:1;s:3:"694";i:2;s:3:"697";i:3;s:3:"695";i:4;s:3:"696";}
问题是,我无法获取图像URL。我的代码:
<?php $ppics = get_post_meta( get_the_ID(), \'shop_demosc\', false );
$ppurl = wp_get_attachment_url($ppics);
foreach ($ppics as $key => $ppurl){
echo \'<img src="\'. print_r($ppurl) .\'">\';
} ?>
此代码返回:
Array
(
[0] => 694
[1] => 694
[2] => 697
[3] => 695
[4] => 696
)
怎么了?如何获取5幅图像的URL?