<?php

/**
 * Displays the new series part
 *
 * @package WordPress
 * @subpackage IZI_THEME
 * @since 1.0.0
 */
?>
<!-- NEW SERIES BEGIN -->
<section class="container mt-5">
    <h2 class="htitles text-start mb-5">Nouvelles séries</h2>
    <div class="row text-center">
    <?php
        $argnewseries = array(
            'post_type'			=> 'series',
            'posts_per_page' 	=> 4,
            'posts_exlude' 	=> -1,
        );
        $newseries = new WP_Query( $argnewseries );
        
        if ( $newseries->have_posts() ) : while ( $newseries->have_posts() ) : $newseries->the_post();
    ?>
    
        <div class="col-12 col-sm-6 col-lg-3 mb-4">
            <div class="card border-0 img-zoom">
                <a class="text-decoration-none" href="<?php the_permalink(); ?>">
                <?php the_post_thumbnail('full', array('class' => 'img-fluid w-100')); ?>
                    <h2><?php the_title(); ?></h2>
                </a>
            </div>
        </div>

        <?php endwhile; else: ?>
            <div class="article-content">
                <p>Aucun contenu à afficher</p>
            </div>
        <?php
        endif;
        // Restore original post data.
        wp_reset_postdata();
        ?>

        
        <div class="d-grid gap-2 d-lg-flex justify-content-lg-center">
            <a href="series" class="btn btn-gradient btn-border" role="button" aria-pressed="true">voir
                plus...</a>
        </div>
    </div>
</section>
<!-- NEW SERIES END -->