I'm creating a post gallery like that of globo.com where 3 different posts appear at once.
The problem is that it only takes a post, I would like * posts to be inserted within div
without being repeated.
<div class="row">
<?php $do_not_duplicate = array(); ?>
<?php
$args = array( 'post_type' => 'post', 'posts_per_page' => 1, 'cat' => 1);
$mosaics = new WP_Query( $args ); ?>
<?php while ($mosaics->have_posts()) : $mosaics->the_post(); ?>
<?php $do_not_duplicate[] = $post->ID; ?>
<div class="img1">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"> <?php the_post_thumbnail('class => img-responsive'); ?> </a>
</div>
<?php endwhile; wp_reset_postdata(); ?>
<?php wp_reset_query(); ?>
</div>
<div class="row">
<?php $do_not_duplicate = array(); ?>
<?php
$args = array( 'post_type' => 'post', 'posts_per_page' => 1, 'cat' => 1);
$mosaics = new WP_Query( $args); ?>
<?php while ($mosaics->have_posts()) : $mosaics->the_post(); ?>
<?php $do_not_duplicate[] = $post->ID; ?>
<div class="img2 col-md-12">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"> <?php the_post_thumbnail('class => img-responsive'); ?> </a>
</div>
<?php endwhile; wp_reset_postdata(); ?>
</div>
How's it going: