Wordpress newb。
$article_data = get_field('article_item');
foreach ($article_data as $key => $item) {
$footerImg = (!empty($item['bottom_image'])) ? $item['bottom_image'] : NULL;
$url = implode( ', ', $footerImg );
echo $url;
}输出如下:
2345,
67899,
boston_skyline,
boston_skyline.jpg,
http://localhost:8000/bostontheme/images/2018/08/boston_skyline.jpg,
2018-08-07 01:24:21如何抓取其中的图像字符串,以便执行以下操作:
<img src="<?php echo $url ?>" />当我这样做的时候
print_r($item);我得到以下输出:
Array (
[bottom_image] => Array (
[ID] => 67899
[id] => 67899
[title] => boston_skyline
[filename] => boston_skyline.jpg
[url] => http://localhost:8000/bostontheme/images/2018/08/boston_skyline.jpg发布于 2018-08-07 21:49:17
简单地说,您需要的是$item["bottom_image"]["url"]
https://stackoverflow.com/questions/51718055
复制相似问题