I’m trying to convert a HTML slider into wordpress by custom post. Here is the HTML Markup for the slider
<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>
I converted many slider using custom post before but this sliders markup is something complex to me and can’t understand How to convert this slider into wordpress.
Please see this screenshot, that will be easy to understand.
Normally I use the below query to convert slider. Please help me someone by giving me the custom post query code to convert the above slider. Advance Thanks! to all.
`<?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 } ?>`
1 comment