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
#1
你只需要$ item [” bottom_image”] [” url”]
评论前必须登录!
注册