<section class="hero-slider hero-style">
    <div class="swiper-container">
        <div class="swiper-wrapper">
            <?php
            $taxon = get_field('slider_post', 'option');
            $args_all = array(
                'post_type' => 'post',
                'posts_per_page' => 5,
                'cat' => $taxon,
                'orderby' => 'date',
                'order' => 'DESC',
            );
            $query_all = new WP_Query($args_all);
            if ($query_all->have_posts()) :
                while ($query_all->have_posts()) : $query_all->the_post();
                    ?>
                    <div class="swiper-slide">
                        <div class="slide-inner slide-bg-image"
                             data-background="<?php echo get_the_post_thumbnail_url(); ?>">
                            <div class="shadow-back"></div>
                            <div class="container">
                                <div data-swiper-parallax="400" class="slide-text">
                                    <p><?php the_title(); ?></p>
                                </div>
                                <div class="clearfix"></div>
                                <div data-swiper-parallax="500" class="slide-btns">
                                    <a href="<?php the_permalink(); ?>" class="theme-btn-s2">بیشتر بخوانید</a>
                                </div>
                            </div>
                        </div>
                        <!-- end slide-inner -->
                    </div>
                <?php
                endwhile;
                wp_reset_postdata();
            endif;
            ?>
        </div>
        <!-- end swiper-wrapper -->

        <!-- swipper controls -->
        <div class="swiper-pagination"></div>
        <div class="swiper-button-next"></div>
        <div class="swiper-button-prev"></div>
    </div>
</section>
