<?php 
$backgroundcolor = $instance['backgroundcolor'];
$testimonials_per_page = $instance['testimonials_per_page'];

$button_text = $instance['button_text'];
$button_url = $instance['button_url'];

$excerpt = 'true';

?>
  <section class="half-section" style="background-color:<?php echo $backgroundcolor; ?> ">
            <div class="container">
                <div class="row overlap-gap-section">
                    <div class="col-12 col-md-4 position-relative sm-padding-10-rem-bottom xs-padding-9-rem-bottom">
                        <h1 class="alt-font font-weight-600 text-extra-dark-gray letter-spacing-minus-2px margin-5-rem-bottom"><span class="text-border text-border-color-black text-border-width-2px opacity-3"><?php echo esc_attr( $instance['title'] ); ?> </span> <?php echo esc_attr( $instance['subtitle'] ); ?> </h1>
                        <div class="swiper-button-next-nav-02 swiper-button-next slider-navigation-style-03 white rounded-circle"><i class="feather icon-feather-arrow-right"></i></div>
                        <div class="swiper-button-previous-nav-02 swiper-button-prev slider-navigation-style-03 white rounded-circle"><i class="feather icon-feather-arrow-left"></i></div>
                    </div>
                    <div class="col-12 col-xl-5 col-lg-6 offset-lg-1 col-md-8 swiper-simple-arrow-style-1" data-wow-delay="0.2s">
                        <div class="swiper-container black-move" data-slider-options='{ "loop": true, "slidesPerView": 1, "observer": true, "observeParents": true, "navigation": { "nextEl": ".swiper-button-next-nav-02", "prevEl": ".swiper-button-previous-nav-02" }, "autoplay": { "delay": 4500, "disableOnInteraction": false }, "keyboard": { "enabled": true, "onlyInViewport": true }, "effect": "slide" }'>
                            <div class="swiper-wrapper">
                                
                                   	     <?php
          
            $qargs = array(
                'post_status'       => 'publish',
                'post_type'         => 'testimonials',
                'posts_per_page'    => $testimonials_per_page
            );
            $postCount = 0;
            $recentPosts = new WP_Query( $qargs );
         
            if ( $recentPosts->have_posts() ) : ?>

                <?php while( $recentPosts->have_posts() ) : $recentPosts->the_post();
                
                	if(has_post_thumbnail(get_the_ID(), 'full'))
	{
	
	    $image=get_the_post_thumbnail_url(get_the_ID(),'swap-gallery');
	}
                	else
	{
	    $image = TMPL . "assets/images/fav.png";
	}
              ?>
    
                                
                                <!-- start testimonial item -->
                                <div class="swiper-slide">
                                     <span class="alt-font text-large line-height-38px md-line-height-32px letter-spacing-minus-1-half d-block margin-3-rem-bottom">
                                     <blockquote class="border-width-6px  border-color-gray lg-no-margin-tb xl-no-margin-tb  md-no-margin-tb md-no-padding-right xs-no-margin-tb"> 
                                  <p>   <?php
                                $excerpt = get_the_excerpt();
                                echo $excerpt;
                                ?></p>
                                </blockquote>
                                </span>
                                 
                                    <div class="feature-box feature-box-left-icon-middle">
                                        <div class="feature-box-icon margin-25px-right">
                                            <img class="rounded-circle w-85px h-85px" src="<?php echo $image; ?>" alt="<?php echo SITE_TITLE;?>" />
                                        </div>
                                        <div class="feature-box-content">
                                            
                                            
                                            
                                            <div class="text-extra-dark-gray text-large alt-font line-height-20px text-blue text-uppercase d-inline-block"><span class="font-weight-600"><?php echo the_title();?></span> </div>
                                           
                                            <span class="alt-font text-medium d-block text-uppercase margin-5px-top"><?php 
                                        
                                       
                                       	$testimonial_designation = get_post_meta(get_the_ID(), 'testimonial_designation', true); 
                                       

   echo $testimonial_designation;
                           

?></span>
                                        </div>
                                    </div>
                                </div>
                                <!-- end testimonial item -->
                               <?php  endwhile; 
           endif; 
            wp_reset_postdata();  ?>
                            </div> 
                        </div>
                    </div>
                </div>
            </div>
        </section>


