<?php if ('layout_one' == $settings['layout_type']) : ?>
    <section class="blog-two">
        <div class="container">
            <div class="row">
                <div class="col-md-8">
                    <div class="sec-title-two">
                        <<?php echo esc_attr($settings['section_sub_title_tag_layout_one']); ?> class="sec-title-two__tagline">
                            <span class="sec-title-two__tagline__icon">
                                <?php \Elementor\Icons_Manager::render_icon($settings['sec_icon'], ['aria-hidden' => 'true'], 'i'); ?>
                            </span><?php echo wp_kses($settings['sec_title'], 'ostech_allowed_tags'); ?>
                        </<?php echo esc_attr($settings['section_sub_title_tag_layout_one']); ?>><!-- /.sec-title-two__tagline -->

                        <?php
                        if (!empty($settings['sec_sub_title'])) :
                            $this->add_inline_editing_attributes('sec_sub_title', 'none');
                            ostech_elementor_rendered_content($this, 'sec_sub_title', 'sec-title-two__title', $settings['section_title_tag_layout_one']);
                        endif;
                        ?>
                    </div><!-- /.sec-title-two -->
                </div>
                <?php if (!empty($settings['button_url']['url'])) : ?>
                    <div class="col-md-4">
                        <a href="<?php echo esc_url($settings['button_url']['url']); ?>" class="ostech-btn ostech-btn--icon">
                            <span><?php echo esc_html($settings['button_label']); ?><span class="ostech-btn--icon__icon"><i class="ostech-icons-two-up-right-arrow"></i></span></span>
                        </a>
                    </div>
                <?php endif; ?>
            </div>
            <div class="blog-one__carousel ostech-owl__carousel ostech-owl__carousel--with-shadow ostech-owl__carousel--basic-nav owl-carousel owl-theme" data-owl-options='<?php echo esc_attr(ostech_get_owl_options($settings)); ?>'>
                <?php
                foreach ($settings['layout_one_blog_post'] as $item) : ?>
                    <?php
                    $blog_post_one_query_args = array(
                        'post_type' => 'post',
                        'post_status' => 'publish',
                        'ignore_sticky_posts' => true,
                        'orderby' => 'date',
                        'post__in' => array($item['select_post'])
                    );
                    $blog_post_one_query = new \WP_Query($blog_post_one_query_args);
                    ?>
                    <?php while ($blog_post_one_query->have_posts()) :
                        $blog_post_one_query->the_post();
                        $category =  get_the_terms(get_the_ID(), 'category');
                    ?>
                        <div class="item">
                            <div class="blog-card-three  wow fadeInUp" data-wow-duration='1500ms' data-wow-delay='00ms'>
                                <div class="blog-card-three__image">
                                    <img src="<?php echo esc_url($item['image']['url']); ?>" alt="<?php echo esc_attr(ostech_get_thumbnail_alt($item['image']['id'])); ?>">
                                    <img src="<?php echo esc_url($item['image']['url']); ?>" alt="<?php echo esc_attr(ostech_get_thumbnail_alt($item['image']['id'])); ?>">
                                    <a href="<?php the_permalink(); ?>" class="blog-card-three__image__link"></a>
                                    <div class="blog-card-three__date">
                                        <span><?php echo get_the_date('d'); ?></span><?php echo get_the_date('M'); ?>
                                    </div><!-- /.blog-card-three__date -->
                                </div><!-- /.blog-card-three__image -->
                                <div class=" blog-card-three__content">
                                    <h3 class="blog-card-three__title">
                                        <a href="<?php the_permalink(); ?>">
                                            <?php if (empty($item['custom_title'])) : ?>
                                                <?php echo esc_html(wp_trim_words(get_the_title(), $item['title_length'], '')); ?>
                                            <?php else : ?>
                                                <?php echo wp_kses($item['custom_title'], 'insur_allowed_tags'); ?>
                                            <?php endif; ?>
                                        </a>
                                    </h3><!-- /.blog-card-three__title -->
                                    <ul class="list-unstyled blog-card-three__meta">
                                        <li>
                                            <?php ostech_posted_by(); ?>
                                        </li>
                                        <li>
                                            <?php ostech_comment_count(); ?>
                                        </li>
                                    </ul><!-- /.list-unstyled blog-card-three__meta -->
                                </div><!-- /.blog-card-three__content -->
                            </div><!-- /.blog-card-three -->
                        </div><!-- /.item -->
                    <?php endwhile; ?>
                    <?php wp_reset_postdata(); ?>
                <?php endforeach; ?>
            </div><!-- /.row -->
        </div><!-- /.container -->
    </section><!-- /.blog-two -->


<?php endif; ?>