I have a slider that i'd like to load 3 blog posts into each slide. I'm having a problem getting them all out correctly. I'm using Flexslider. The idea is to get 3 blog posts at a time into each slide.
any help would be greatly appreciated!
My Markup: - I need each 3 posts go into the li
<?php $argsb = array('posts_per_page' => 3, 'post_status' => 'publish');?>
<?php $blog = new WP_Query($argsb); if ( $blog->have_posts() ):?>
<section class="blog-slider slider">
<div class="flexslider">
<ul class="slides">
<li class="slide">
<?php while ( $blog->have_posts() ) : $blog->the_post(); $count++;?>
<article class="blog-post-slide<?php if ( 0 == $count%2 ) {echo' middle-blog-slide';} ?>">
<?php if ( has_post_thumbnail() ) {?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><div class="blog-slide-image"><?php the_post_thumbnail('blog-slide');?></div></a>
<?php } ?>
<?php the_title();?>
</article>
<?php endwhile; wp_reset_postdata();?>
</li>
</ul>
</div>
</section>
<?php endif; ?>
Aucun commentaire:
Enregistrer un commentaire