[The Loop] Put every 2 posts in a div
-
I have this code below. What I’m trying to do is contain each pair of 2 posts in between the <div class”ef-slide”> How would I do that?
<div class="ef-slide"> <?php $recent_blog_posts = new WP_Query('posts_per_page=6'); if ($recent_blog_posts->have_posts()) : while ($recent_blog_posts->have_posts()) : $recent_blog_posts->the_post(); get_template_part( 'content' ); endwhile; else : echo "No Posts"; endif; ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘[The Loop] Put every 2 posts in a div’ is closed to new replies.