File: /home/kashmira/public_html/razitahir.com/wp-content/themes/upress/template-parts/posts-block2.php
<div class="block-head">
	<h2><?php echo get_cat_name( $block_cat ) ?></h2>
</div>
<div class="block-body block-large">
<?php
// The Query
$i = 1;
$args = array(
	'cat' => $block_cat,
	'posts_per_page' => 8
);
$posts_query = new WP_Query( $args );
// The Loop
if ( $posts_query->have_posts() ) {
	while ( $posts_query->have_posts() ) {
		$posts_query->the_post(); ?>
		<?php if($i < 3) { ?>
		<div class="mb-10 col-lg-8 col-md-8 col-sm-16 col-xs-16 pr-0 pl-5">
			<div class="post-content">
				<div class="block-post-row block-post-thumbnail">
					<a href="<?php the_permalink() ?>">
					<?php
						if ( has_post_thumbnail() ) {
							the_post_thumbnail('postblock-large');
						}
						else {
							echo '<img src="' . get_bloginfo( 'stylesheet_directory' ) . '/images/nothumb.png" />';
						}
					?>
					</a>
				</div>
				<div class="block-post-row">
					<h4>
						<a href="<?php the_permalink() ?>">
							<?php
								$trimtitle = get_the_title(); 
								$shorttitle = wp_trim_words( $trimtitle, $num_words = 12, $more = '… ' ); 
								echo $shorttitle;
							?>
						</a>
					</h4>
					<div class="post-info pt-5 pb-5">
						<small><?php $comments_count = wp_count_comments(get_the_ID()); ?></small>
						<?php unews_posted_on() ?>
						<sann class="post-comments mr-10">
							<i class="fa fa-comment-o"></i> <?php echo $comments_count->approved ?> <?php _e("تبصرے") ?>
						</sann>
						<span class="post-views mr-10"><i class="fa fa-eye"></i> <small><?php echo getViews(get_the_ID()) ?></small> <?php _e("مناظر") ?></span>
					</div>
				</div>
				<div class="block-post-row">
					<p> <?php remove_empty_p(the_excerpt()) ?></p>
				</div>
				
			</div>
		</div>
		<?php } else { ?>
		<div class="pb-5 mb-10 block-post-smallrow noborder pull-right col-lg-8 col-md-8 col-sm-16 col-xs-16 pl-0 pr-0">
			<div class="post-content">
				<div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 pull-right pr-0">
					<a href="<?php the_permalink() ?>">
					<?php
						if ( has_post_thumbnail() ) {
							the_post_thumbnail('medium');
						}
						else {
							echo '<img src="' . get_bloginfo( 'stylesheet_directory' ) . '/images/nothumb.png" />';
						}
					?>
					</a>
				</div>
				<div class="col-lg-11 col-md-11 col-sm-11 col-xs-11 pr-0">
					<h5>
						<a href="<?php the_permalink() ?>">
							<?php
								$trimtitle = get_the_title(); 
								$shorttitle = wp_trim_words( $trimtitle, $num_words = 12, $more = '… ' ); 
								echo $shorttitle;
							?>
						</a>
					</h5>
				</div>
			</div>
		</div>
		<?php } ?>
	<?php
	$i++; }
} else {
	// no posts found
}
/* Restore original Post Data */
wp_reset_postdata();
?>
</div>