<?php 
if ( get_query_var('paged') ) {
    $paged = get_query_var('paged');
 } elseif ( get_query_var('page') ) {
    $paged = get_query_var('page');
 } else {
    $paged = 1;
 }
$query_args = array(
    'post_type' => 'post',
    'posts_per_page' => $settings['posts_per_page'],
    'paged'     => $paged
);
if (! empty( $settings['posts_categories'] )) {
    $query_args['category_name'] = implode(',', $settings['posts_categories']);
}        
if ( ! empty( $settings['exclude'] ) ) {				
    if ( ! is_array( $settings['exclude'] ) )
        $exclude = explode( ',', $settings['exclude'] );

    $query_args['post__not_in'] = $exclude;
}
$query_args['orderby'] = $settings['order_by'];
$query_args['order'] = $settings['order'];	
$query = new WP_Query( $query_args );

?>
<?php while ( $query->have_posts() ) : $query->the_post();?>
<?php 
$get_id_post_thumbnail = get_post_thumbnail_id();
$featured_image = sprintf('<img src="%s" alt="image">', \Elementor\Group_Control_Image_Size::get_attachment_image_src( $get_id_post_thumbnail, 'thumbnail', $settings ));  
?>
	<div class="item">
		<div class="entry blog-post ">
				<div class="featured-post">
					<a href="<?php echo esc_url( get_permalink() ) ?>">
						<?php echo sprintf( '%s', $featured_image ); ?>
						<span class="blog-plus"></span>
					</a>
                    <div class="content">
                            <?php   
                                $archive_year  = get_the_time('Y'); 
                                $archive_month = get_the_time('m'); 
                                $archive_day   = get_the_time('d'); ?>               
                                <a class="meta-text" href="<?php echo esc_url(get_day_link( $archive_year, $archive_month, $archive_day));  ?>"><?php echo get_the_date(); ?></a>
                            <h6 class="title"><a href="<?php echo esc_url( get_the_permalink() ); ?>"
                                    title="<?php echo esc_attr( get_the_title() ); ?>"><?php echo get_the_title(); ?></a></h6>
                            <div class="post-meta">
                                <div class="inner">
                                <?php  printf(
                            '<a class="author" href="%s" title="%s" rel="author"><span>%s</span> </a>',
                            esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) )),
                            esc_attr( sprintf( esc_html__( 'View all posts by %s', 'homeya' ), get_the_author() ) ),get_the_author()); ?>
                                </div>
                                <div class="inner">
                                    <?php the_category( ', ' ); ?>
                                </div>
                            </div>
                    </div>
				</div>
		</div>
	</div>
<?php endwhile; ?>