<div class="anews-featured-post-wrapper">
        <div class="container">
            <div class="row">
                <?php
                    $anews_iboxs = get_theme_mod( 'anews_home_post_bx_settings' );
                    foreach($anews_iboxs as $anews_ibox) :
                    if( true == $anews_ibox['anews_home_ibox_cat_show'] ){
                        $p = new \WP_Query( array( 
                            'posts_per_page' => 3,
                            'post_type' => 'post',
                            'order' => $anews_ibox['anews_home_ibox_orderby'],
                            'tax_query' => array(
                                array(
                                    'taxonomy' => 'category',
                                    'field' => 'term_id',
                                    'terms' => $anews_ibox['anews_home_ibox_cat'],
                                )
                            ),
                        ));
                    }else{
                        $p = new \WP_Query( array( 
                            'posts_per_page' => 3,
                            'post_type' => 'post',
                            'order' => 'DESE',
                        ));
                    }
                ?>
                <div class="col-12 col-sm-12 col-md-6 col-lg-4">
                    <div class="anews-featured-post-items">
                        <div class="section-title"><?php echo esc_html($anews_ibox['anews_home_ibox_title']); ?></div>
                        <?php while ( $p->have_posts() ): $p->the_post(); 
                        $anews_current_index = $p->current_post+1;
                        $anews_cols = ($anews_current_index % 5 == 1) ? 'full-width' : 'list';
                        ?>
                        <div class="anews-recent-post-lists <?php echo esc_attr($anews_cols); ?>">
                            <div class="anews-hpost-item">
                                <?php if(has_post_thumbnail()) : ?>
                                <div class="hpost-img">
                                    <a href="<?php echo esc_url(the_permalink()); ?>"><?php the_post_thumbnail('full', array('class' => 'img-responsive')); ?></a>
                                </div>
                                <?php endif; ?>
                                <div class="hpost-contents">
                                    <div class="anews-home-post-meta">
                                        <ul>
                                            <?php if(($anews_current_index % 5 == 1)){
                                                anews_post_cat();
                                            } ?>
                                            <span> <i class="fas fa-calendar"></i><?php echo esc_html(get_the_date( 'd M, Y', $post->ID )); ?></span>
                                        </ul>
                                    </div>
                                    <h2><a href="<?php echo esc_url(the_permalink()); ?>"><?php the_title(); ?></a></h2>
                                </div>
                            </div>
                        </div>
                        <?php endwhile; wp_reset_query(); ?>
                        <a href="<?php echo esc_url($anews_ibox['anews_home_ibox_readmore']); ?>" class="allpost"><?php esc_html_e('View All','anews'); ?> <i class="fas fa-angle-double-right"></i></a>
                    </div>
                </div>
                <?php endforeach; ?>
            </div>
        </div>
    </div>