에 대한 사용자 지정 게시물 쿼리 사용자 지정 게시물에 의해 HTML 슬라이더를 WordPress로 변환하려고합니다. 다음은 HTML 마크 업 내가하지만,이 슬라이더 마크 업이 나에게 뭔가 복잡하고 워드 프레스에이 슬라이더를 변환하는 방법을 이해할 수 없다 전에 사용자 정의 포스트를 사용하여 많은 슬라이더를 변환Wordpress 슬라이더
<div class="slider"> <div class="slide_item"> <div class="child_item_of_every_slide">Child Slide Items with different Content</div> <div class="child_item_of_every_slide">Child Slide Items with different Content</div> <div class="child_item_of_every_slide">Child Slide Items with different Content</div> <div class="child_item_of_every_slide">Child Slide Items with different Content</div> </div> <div class="slide_item"> <div class="child_item_of_every_slide">Child Slide Items with different Content</div> <div class="child_item_of_every_slide">Child Slide Items with different Content</div> <div class="child_item_of_every_slide">Child Slide Items with different Content</div> <div class="child_item_of_every_slide">Child Slide Items with different Content</div> </div> <div class="slide_item"> <div class="child_item_of_every_slide">Child Slide Items with different Content</div> <div class="child_item_of_every_slide">Child Slide Items with different Content</div> <div class="child_item_of_every_slide">Child Slide Items with different Content</div> <div class="child_item_of_every_slide">Child Slide Items with different Content</div> </div> </div>
슬라이더입니다.
Please see this screenshot, 이는 쉽게 이해할 수 있습니다.
일반적으로 아래의 쿼리를 사용하여 슬라이더를 변환합니다. 위의 슬라이더를 변환 할 사용자 정의 게시물 쿼리 코드를 제공하여 다른 사람을 도와주세요. 미리 감사드립니다! 모든.
`<?php if(!is_paged()) { ?>
<?php
$args = array('post_type' => 'slider', 'posts_per_page' => 5);
$loop = new WP_Query($args);
?>
<?php while ($loop->have_posts()) : $loop->the_post(); ?>
<div class="slide_item">
<div class="child_item_of_every_slide">Child Slide Items with different Content</div>
</div>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
<?php } ?>`
탱크를 많이! 그것의 작동! –
기꺼이 도와 드리겠습니다. 그것이 효과가 있다면 당신은 대답을 upvote 수 있습니다. – Yamu