누군가 도움이 될 수 있습니다. 이 코드를 표준 템플릿에 넣었지만 이미지가있는 게시물이 많은데도 이미지가 표시되지 않습니다.WordPress : 전면 이미지에 게시물 이미지 표시
<?php if (have_posts()) : while (have_posts()) : the_post();
$images =& get_children(array (
'post_parent' => $post->ID,
'post_type' => 'attachment',
'post_mime_type' => 'image'
));
if (empty($images)) {
// no attachments here
} else {
foreach ($images as $attachment_id => $attachment) {
echo wp_get_attachment_image($attachment_id, 'thumbnail');
}
}
endwhile; endif; ?>
감사합니다.
이미지 만 표시하면 되나요? 이미지가 특집 이미지로 설정되어 있습니까? –
아니요, 추천 이미지로 설정되지 않았습니다. 이미지 만 표시하면됩니다. 나는 그들을 배치하기 위해 Masonry와 CSS를 사용할 것이다. – natnai