<section class="parallax primary-overlay-solid"
         data-background="<?php echo get_template_directory_uri() ?>/img/advertisers10.png">
    <div class="container">
        <h4 class="col-12 mb-1-9 rtl"><?php echo esc_html(get_field('display_ads_title', 'option')); ?>
            <svg class="header-line" width="178" height="7" viewBox="0 0 178 7" fill="none"
                 xmlns="http://www.w3.org/2000/svg">
                <rect width="178" height="7" fill="#0189D0"/>
            </svg>
        </h4>

        <!-- Start Related Product -->
        <div class="row">

            <div class="carousel-style1 col-12 product-grid-style">
                <div class="product-grid control-top owl-carousel owl-theme">

                    <?php
                    $taxon = get_field('dispaly_ads', 'option');
                    $args_all = array(
                        'post_type' => 'post',
                        'posts_per_page' => 5,
                        'cat' => $taxon,
                        'orderby' => 'date',
                        'order' => 'DESC',
                    );

                    $query_all = new WP_Query($args_all);

                    // Check if there are any posts
                    if ($query_all->have_posts()) :
                        while ($query_all->have_posts()) : $query_all->the_post();
                            // Display slide for each post
                            ?>
                            <div>
                                <article class="blog-grid">
                                    <div class="blog-grid-img position-relative">
                                        <img class="main-part-img" alt="<?php echo get_the_title(); ?>"
                                             src="<?php echo get_the_post_thumbnail_url(get_the_ID(), 'large'); ?>">
                                    </div>
                                    <div class="blog-grid-text p-4">
                                        <span class="blog-item-category"><?php echo get_the_category_list(', '); ?></span>
                                        <h3 class="h5 blog-item-title"><a
                                                    href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
                                        <span class="blog-item-date"><?php echo get_the_date('d F Y'); ?></span>
                                    </div>
                                </article>
                            </div>
                        <?php endwhile;
                        wp_reset_postdata();
                    endif;
                    ?>

                </div>
            </div>

        </div>
        <!-- End Related Product -->
    </div>
</section>
