【发布时间】:2013-11-30 00:24:39
【问题描述】:
我最近为 wordpress 安装了动态特色图片插件。但我不知道如何链接图像。我正在尝试为我创建一个这样的画廊http://www.subcreative.com.au/#work - 向下滚动到项目,你会看到。
我已经把这段代码放在functions.php中
<?php
while ( have_posts() ) : the_post();
if( function_exists('dfi_get_featured_images') ) {
$featuredImages = dfi_get_featured_images();
//Now, loop through the image to display
}
endwhile;
?>
并用它来链接图像。
echo ' <a class="fancybox" href="'. dfi_get_featured_images() .'" style="text-align:center">Take a look</a> '; ?>
但是当我尝试打开图片时,它变成了“/array”
【问题讨论】:
-
错误告诉你去哪里看。您需要从已创建的数组中选择一个项目。您可能需要上传比这更多的代码来帮助我们,看起来有其他 PHP 正在与此对话,例如 dfi_get_features_images() 函数的代码
标签: php arrays wordpress dynamic-featured-image