<div class="anews-tranding-sections home-post-section">
        <div class="container">
            <div class="row">
                <?php
                global $post;
                if( true == get_theme_mod( 'anews_home_td_show' ) ) {
                    $p = new \WP_Query( array( 
                        'posts_per_page' => 4,
                        'post_type' => 'post',
                        'order' => esc_attr(get_theme_mod( 'anews_tranding_post_order' )),
                        'tax_query' => array(
                            array(
                                'taxonomy' => 'category',
                                'field' => 'term_id',
                                'terms' => get_theme_mod( 'anews_home_tranding_cat' ),
                            )
                        ),
                    ));
                }else{
                    $p = new \WP_Query( array( 
                        'posts_per_page' => 4,
                        'post_type' => 'post',
                        'order' => 'ASC',
                    )); 
                }
                $count = 0;
                ?>
                <?php  while ( $p->have_posts() ): $p->the_post(); $count++ ?>
                <?php if($count == 1) : ?>
                <div class="items col-12 col-sm-12 col-md-12 col-lg-4">
                    <div class="tranding-home-post-item">
                        <div class="anews-home-post-single">
                            <div class="anews-home-post-img">
                                <?php the_post_thumbnail('full', array('class' => 'img-responsive tranding-one')); ?>
                                <div class="anews-home-post-single-content">
                                    <div class="anews-home-post-meta">
                                        <ul>
                                            <?php anews_post_cat(); ?>
                                        </ul>
                                    </div>
                                    <h2><a href="<?php echo esc_url(the_permalink()); ?>"><?php the_title(); ?></a></h2>
                                    <div class="anews-author-post-meta">
                                        <div class="anews-author-post-img">
                                            <?php echo get_avatar( get_the_author_meta( 'ID' )); ?>
                                        </div>
                                        <div class="anews-author-post-name">
                                            <h2><?php echo esc_html(get_the_author()); ?></h2>
                                            <span><?php echo esc_html(get_the_date( 'd M, Y', $post->ID )); ?></span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <?php endif; endwhile; wp_reset_query(); ?>
                <div class="col-12 col-sm-12 col-md-12 col-lg-8">
                    <div class="row">
                        <?php $count = 0; while ( $p->have_posts() ): $p->the_post(); $count++;?>
                        <?php if($count == 2 ) : ?>
                        <div class="col-12">
                            <div class="tranding-home-post-item big">
                                <div class="anews-home-post-single">
                                    <div class="anews-home-post-img">
                                        <?php the_post_thumbnail('full', array('class' => 'img-responsive tranding-two')); ?>
                                        <div class="anews-home-post-single-content">
                                            <div class="anews-home-post-meta">
                                                <?php anews_post_cat(); ?>
                                                <?php if(get_comments_number() != 0) : ?>
                                                <li class="comment-number"><i
                                                    class="fas fa-comment"></i><?php comments_number( 'no Comments', 'one Comment', '% Comments' ); ?>.
                                                </li>
                                                <?php endif; ?>
                                            </div>
                                            <h2><a href="<?php echo esc_url(the_permalink()); ?>"><?php the_title(); ?></a></h2>
                                            <div class="anews-author-post-meta">
                                                <div class="anews-author-post-img">
                                                    <?php echo get_avatar( get_the_author_meta( 'ID' )); ?>
                                                </div>
                                                <div class="anews-author-post-name">
                                                    <h2><?php echo esc_html(get_the_author()); ?></h2>
                                                    <span><?php echo esc_html(get_the_date( 'd M, Y', $post->ID )); ?></span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <?php endif; ?>
                        <?php if($count == 3 ) : ?>
                        <div class="col-12 col-md-6 col-lg-6 post-mini">
                            <div class="tranding-home-post-item">
                                <div class="anews-home-post-single">
                                    <div class="anews-home-post-img">
                                        <?php the_post_thumbnail('full', array('class' => 'img-responsive tranding-three')); ?>
                                        <div class="anews-home-post-single-content">
                                            <div class="anews-author-post-meta">
                                                <div class="anews-author-post-img">
                                                    <?php echo get_avatar( get_the_author_meta( 'ID' )); ?>
                                                </div>
                                                <div class="anews-author-post-name">
                                                    <h2><a
                                                            href="<?php echo esc_url(the_permalink()); ?>"><?php the_title(); ?></a>
                                                    </h2>
                                                    <span><?php esc_html_e('By','anews'); ?>
                                                        <?php echo esc_html(get_the_author()); ?></span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <?php endif; ?>
                        <?php if($count == 4 ) : ?>
                        <div class="col-12 col-md-6 col-lg-6 post-mini">
                            <div class="tranding-home-post-item">
                                <div class="anews-home-post-single">
                                    <div class="anews-home-post-img">
                                        <?php the_post_thumbnail('full', array('class' => 'img-responsive tranding-three')); ?>
                                        <div class="anews-home-post-single-content">
                                            <div class="anews-author-post-meta">
                                                <div class="anews-author-post-img">
                                                    <?php echo get_avatar( get_the_author_meta( 'ID' )); ?>
                                                </div>
                                                <div class="anews-author-post-name">
                                                    <h2><a
                                                            href="<?php echo esc_url(the_permalink()); ?>"><?php the_title(); ?></a>
                                                    </h2>
                                                    <span><?php esc_html_e('By','anews'); ?>
                                                        <?php echo esc_html(get_the_author()); ?></span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <?php endif; endwhile; wp_reset_query();?>
                    </div>
                </div>
            </div>
        </div>
    </div>