>  Q&A  >  본문

Jquery 슬라이더가 올바르게 표시되지 않는 이유는 무엇입니까?

고급 사용자 정의 필드 플러그인에서 가져온 이미지 슬라이더를 표시하기 위해 WordPress 사용자 정의 테마에 Slick Slider 라이브러리를 구현하려고 합니다. 그러나 슬라이더가 이미지를 서로 겹쳐서 표시하고 슬라이더 기능이 작동하지 않는 문제가 발생했습니다.

지금까지 내가 한 일은 다음과 같습니다.

으아아아

차일드 테마의 function.php에 추가한 코드입니다

<article>
    <div class="entry-content">
        <h2 class="wp-block-heading has-text-align-center"><?php the_title(); ?></h2>
        <div class="hotel-description"><h2> Hotel Description: </h2> <?php echo $hotel_description; ?></div>
        <div class="hotel-services"><h2> Hotel Services </h2><?php echo $hotel_services; ?></div>

 <div class="hotel-images-slider">
    <?php
    // Output the images
    if ($hotel_image || $hotel_image2 || $hotel_image3) {
        echo '<div>';
        if ($hotel_image) {
            echo '<img src="' . esc_url($hotel_image['sizes']['medium']) . '" alt="' . esc_attr($hotel_image['alt']) . '" class="custom-image-class" />';
        }
        if ($hotel_image2) {
            echo '<img src="' . esc_url($hotel_image2['sizes']['medium']) . '" alt="' . esc_attr($hotel_image2['alt']) . '" class="custom-image-class" />';
        }
        if ($hotel_image3) {
            echo '<img src="' . esc_url($hotel_image3['sizes']['medium']) . '" alt="' . esc_attr($hotel_image3['alt']) . '" class="custom-image-class" />';
        }
        echo '</div>';
    }
    ?>
</div>


        

    <?php

endwhile;
?>
    </article>

P粉151720173P粉151720173172일 전389

모든 응답(1)나는 대답할 것이다

  • P粉310754094

    P粉3107540942024-04-04 10:01:49

    여러 이미지가 포함된 <div> 本身,您目前只有一个 <div>에 이미지를 넣으세요:

    으아아아

    회신하다
    0
  • 취소회신하다