<div class="swiper-wrapper">
<?php
for ($i=0; $i<$list_count; $i++) {
$thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $thumb_width, $thumb_height, false, true);
if($thumb['src']) {
$img = $thumb['ori'];
} else {
$img = G5_IMG_URL.'/no_img.png';
$thumb['alt'] = '이미지가 없습니다.';
}
$img_content = '<img src="'.$img.'" alt="'.$thumb['alt'].'" >';
$wr_href = get_pretty_url($bo_table, $list[$i]['wr_id']);
?>
<div class="swiper-slide"><?php echo run_replace('thumb_image_tag', $img_content, $thumb); ?></div>
<?php } ?>
<?php if ($list_count == 0) { //게시물이 없을 때 ?>
<div class="swiper-slide">
게시물이 없습니다.
</div>
<?php } ?>
</div>
swiper를 사용하여 최신글을 만들고 있습니다.
다만 해당 게시판이 첨부파일 2개여서
1번째의 첨부파일이 있을때도있고, 없을때도 있어
해당 구문을 if문으로 추가해주려고 하는데
get_list_thumbnail 을 이용하다보니 뭔가 구문이 복잡해지네요
그동한 참고한 검색은 특정 첨부파일 불러오기 등,, 다양하게 사용해보았지만 활용이 불가하였습니다.
답변주시면 감사하겠습니다.
답변 2개
뷰페이지를 보시면 이미지와 다른 파일을 구분해서 불러오는걸 보실수 있습니다. 참고해서 이미지 구분을 해서 작업을 진행해보시면 될거 같습니다.
잘 모르지만, 의견 남겨봅니다!
최신글을 불러오는거면 latest.skin.php 불러오시는거죠?
그럼 그 안에 li에 swiper-slide로 잡아주고, 그 안에서 첨부파일 불러와지게
작업하시면 되지 않을까요??
답변을 작성하려면 로그인이 필요합니다.