我最近为 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;
?>
Run Code Online (Sandbox Code Playgroud)
并用它来链接图像。
echo ' <a class="fancybox" href="'. dfi_get_featured_images() .'" style="text-align:center">Take a look</a> '; ?>
Run Code Online (Sandbox Code Playgroud)
但是当我尝试打开图像时,它变成“/array”