<div class="container card_box_11">
    <div class="row">
        <?php if ($settings['title']): ?>
        <div class="col-12">
            <div class="head_card_box">
                <span class="head_card_title" style="color:<?php echo $settings['box_title']; ?>">
                    <?php echo $settings['title']; ?>
                </span>
                <?php if ($settings['title_show_more']): ?>
                <a href="<?php echo $settings['website_link']['url']; ?>" class="head_card_more"
                    style="color:<?php echo $settings['box_title_redmor']; ?>">
                    <?php echo $settings['title_show_more']; ?>
                    <i class="fal fa-arrow-left"></i>
                </a>
                <?php endif; ?>
            </div>
        </div>
        <?php endif;
        while ($all_posts->have_posts()) :
        $all_posts->the_post(); ?>
        <div class="col-12 col-sm-6 col-md-4 col-lg-3">
            <div class="cardSuggestions">
                <a href="<?php the_permalink(); ?>" class="card__picture">
                    <?php the_post_thumbnail('articlethumb'); ?>
                </a>
                <div class="card__overload">
                    <a href="<?php the_permalink(); ?>" class="card__overload--link"></a>
                    <?php if ('yes' === $settings['show_more_categories']): ?>
                        <div class="card__overload--categories">
                        <?php
                            $categories = get_the_category();
                            if ( ! empty( $categories ) ) {
                                echo '<a class="card__overload--category" href="' . esc_url( get_category_link( $categories[0]->term_id ) ) . '">' . esc_html( $categories[0]->name ) . '</a>';
                            } ?>
                        </div>
                    <?php endif; ?>
                    <a href="<?php the_permalink(); ?>" class="card__overload--title">
                        <?php the_title(); ?>
                    </a>
                    <?php if ('yes' === $settings['show_more_specifications_1']): ?>
                        <div class="card__overload--info">
                            <div class="card__overload--author">
                                نوشته شده توسط <?php the_author(); ?>
                            </div>
                            <div class="card__overload--date">
                                <?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' پیش'; ?>
                            </div>
                        </div>
                    <?php endif; ?>
                </div>
                <?php if ('yes' === $settings['show_more_icon']):?>
                    <span href="#" class="card__bookmark"></span>
                <?php endif; ?>
            </div>
        </div>
        <?php endwhile; ?>
    </div>