I made a grid with bootstrap the place i wish to present 5 differents posts however for some cause it duplicates the grids and exhibits one put up per grid.
First picture exhibits the way it begins to duplicate the grids 5 occasions as a substitute of simply displaying 5 posts in these columns. Second image exhibits how i wish to work.
<?php get_header(); ?>
<principal>
<div class="container">
<div class="row"> <?php
$args = array(
<?php
'post_type' =>post_type' => 'put up,
'posts_per_page' => 5,
);
$blogposts = new WP_Query($args);
whereas($blogposts->have_posts()) {
$blogposts->the_post(); ?>
<div class="col-md-6">
<a href="<?php the_permalink(); ?>
<div class="card border-0">
<div class="card-picture">
<img class="card-img" src="<?php echo get_the_post_thumbnail_url(get_the_ID()); ?>" alt="Card picture">
<div class="card-img-overlay d-flex flex-column">
<h5 class="card-title font-weight-bold"><?php the_title(); ?></h5>
<div class="mt-auto"> Miika - <i class="fas fa-clock"></i> 16.2.2020 - Oppaat</div>
</div>
</div>
</div>
</a>
</div>
<div class="col-md-6">
<a href="<?php the_permalink(); ?>">
<div class="card border-0">
<div class="card-picture">
<img class="card-img" src="<?php echo get_the_post_thumbnail_url(get_the_ID()); ?>" alt="Card picture">
<div class="card-img-overlay d-flex flex-column">
<h5 class="card-title font-weight-bold"><?php the_title(); ?></h5>
<div class="mt-auto">Miika - <i class="fas fa-clock"></i> 16.2.2020 - Oppaat</div>
</div>
</div>
</div>
</a>
</div>
</div>
<div class="row">
<div class="col-md-4">
<a href="<?php the_permalink(); ?>">
<div class="card border-0">
<div class="card-pic">
<img class="card-img" src="<?php echo get_the_post_thumbnail_url(get_the_ID()); ?>" alt="Card picture">
<div class="card-img-overlay d-flex flex-column">
<h3 class="card-title font-weight-bold"><?php the_title(); ?></h3>
<div class="mt-auto">Miika - <i class="fas fa-clock"></i> 16.2.2020 - Oppaat</div>
</div>
</div>
</div>
</a>
</div>
<div class="col-md-4">
<a href="<?php the_permalink(); ?>">
<div class="card border-0">
<div class="card-pic">
<img class="card-img" src="<?php echo get_the_post_thumbnail_url(get_the_ID()); ?>" alt="Card picture">
<div class="card-img-overlay d-flex flex-column">
<h5 class="card-title font-weight-bold"><?php the_title(); ?></h5>
<div class="mt-auto">Miika - <i class="fas fa-clock"></i> 16.2.2020 - Oppaat</div>
</div>
</div>
</div>
</a>
</div>
<div class="col-md-4">
<a href="<?php the_permalink(); ?>">
<div class="card border-0">
<div class="card-pic">
<img class="card-img" src="<?php echo get_the_post_thumbnail_url(get_the_ID()); ?>" alt="Card picture">
<div class="card-img-overlay d-flex flex-column">
<h5 class="card-title font-weight-bold"><?php the_title(); ?></h5>
<div class="mt-auto">Miika - <i class="fas fa-clock"></i> 16.2.2020 - Oppaat</div>
</div>
</div>
</div>
</a>
</div>
<?php }
wp_reset_query();