<?php 

$projects_per_page = $instance['projects_per_page'];


$button_text = $instance['button_text'];



?>	
<section class="blog px-50 pb-130">
            <div class="container-fluid">
                <div class="blog-head ul_li_between ">
                    <div class="sec-title sec-title--two text-center ">
                        <span class="xb-item--subtitle mb-0"> <?php echo esc_html( $instance['subtitle'] ); ?></span>
                    </div>
                    <!-- <div class="counceling-blog-btn">
                        <a href="<?php echo esc_html( $instance['button_text'] ); ?>" class="thm-btn thm-btn--sm thm-btn--primary mw-238">
                            <span>View More</span>
                        </a>
                    </div>-->
                </div>
				
				
                <div class="row justify-content-center g-32">
				
				
				
				<?php
          
            $qargs = array(
                'post_status'       => 'publish',
                'post_type'         => 'blog',
				'order'				=> 'ASC',
                'posts_per_page'    => $blog_per_page
            );
            $postCount = 0;
            $recentPosts = new WP_Query( $qargs );
         
            if ( $recentPosts->have_posts() ) : ?>

                <?php while( $recentPosts->have_posts() ) : $recentPosts->the_post();
                $meta = get_post_meta( get_the_ID() ); 

$image_thumb = '';
								$blog_ID = get_the_ID();
	if(has_post_thumbnail(get_the_ID(), 'swap-blog'))
	{
	    $image_id = get_post_thumbnail_id(get_the_ID());
	    $image_thumb = wp_get_attachment_image_src($image_id, 'swap-blog', true);
	}
	?>

                    <div class="col-lg-4 col-md-6 mt-30">
                        <div class="blog-single wow fadeInUp" data-wow-delay="0ms" data-wow-duration="400ms">
                            <div class="xb-item--image" data-cursor-text="View">
                                <a href="<?php echo get_permalink( ); ?>"><img src="<?php echo $image_thumb[0]; ?>" alt="<?php the_title(); ?>"></a>
                            </div>
                            <div class="xb-item--content">
                                <span class="xb-item--cat"><?php echo date_i18n('d M Y', get_the_time('U')); ?></span>

                                <h2 class="xb-item--title border-effect"><a href="<?php echo get_permalink( ); ?>"><?php the_title(); ?></a></h2>
                                
                            </div>
                        </div>
                    </div>
                    
                     <?php endwhile;  endif; 
            wp_reset_postdata();  ?>

                </div>
            </div>
        </section>
        <!-- blog end -->