我目前正在尝试在水平滑块中显示我的帖子的特色图片,该滑块同时显示三张图片,然后单击下三个(右/左),但是我无法显示特色图片。
我的代码:
<div id="primary">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class('collections'); ?>>
<header class="entry-header">
<h1 class="entry-title">Collections</h1>
</header>
<div class="entry-content">
<div class="images" >
<a href="#" class="arrow prev" ></a>
<a href="#" class="arrow next"></a>
<div class="wrap" >
<?php
$url = get_permalink();
$images = the_post_thumbnail();
$count = is_array($images) ? count($images) : 0;
if($count)
{
$n = 0; //$images[$i]['url']
for ($i = 0; $i < $count; $i++)
{
$l = $i * 100;
$t = $i * -300;
$big = image_downsize($images[$i]['id'], 'full');
$medium = image_downsize($images[$i]['id'], 'medium');
echo '<a href="', $url,'"
class=" '.(($n==0)?'n':'').' image-holder" '.(($n==0)?'id="n'.$i.'"':'').'><img src="',$big[0],'"
class="image" /></a>';
if($n < 2)
$n++ ;
else
$n = 0;
}
}
?>
<div style="clear:both"></div>
</div>
</div>
</div>
</article>
<?php endwhile; // end of the loop. ?>
</div>
</div>
如果有人可以帮助我解决这个问题,将不胜感激。