현재 내 게시물의 추천 이미지를 가로 슬라이더에 표시하려고합니다. 그 때 3 개의 이미지가 표시되고 그 다음 3 개의 이미지가 한 번 클릭 (오른쪽/왼쪽)되었지만 추천 이미지를 가져올 수 없습니다. 나타나기.wordpress 디스플레이 추천 이미지
내 코드 : 누군가가 나이를 알아내는 데 도움 수 있다면 그것은 주시면 감사하겠습니다
<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>
.
echo 문을 확인하십시오. 연결에 쉼표를 사용하려는 것 같습니다. –
추천 이미지를 얻으려면'get_the_post_thumbnail'을 사용해야합니다 : http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail이 함수는 결코 배열을 반환하지 않고'has_post_thumbnail'을 사용하여 http : // codex를 검사합니다. wordpress.org/Function_Reference/has_post_thumbnail – diggy