<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
<div class="card card-primary" id="post-<?php the_ID(); ?>">
<div class="card-header"><h1><?php the_title(); ?></h1></div>
<div class="article-meta">
<div class="article-category">
<?php $category = get_the_category();
echo"<a href= '" . esc_url( get_category_link( $category[0]->term_id ) ) . "' class='article-category'>" . $category[0]->cat_name . "</a>"; ?>
</div>
<time itemprop="datePublished"><em><?php the_time('j F Y') ?></em></time>
<?php the_excerpt(); ?>
<p class="align-center"> <a href="<?php the_permalink(); ?>" title="<?php the_title();?>" class="btn btn-readmore">Lire l'article</a> </p>
<?php endwhile; ?>
<div class="navigation">
<?php the_posts_pagination(); ?>
<?php endif; ?>