<?php
/*
 * Templatation.com
 *
 *
 */


$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );

?>
<?php if($type=='type1'){ ?>

<section class="our-client sec-padding">
    <div class="thm-container">
        <div class="sec-title">
            <h2><span><?php echo htmlspecialchars_decode($title); ?></span></h2>
        </div>
        <?php
                $args = array(
                    'post_type' => 'tt-client',
                    'posts_per_page' => $number,
                    'order' => $orderpost,
                    'orderby' => $orderby,
                );

                $tt_query = new WP_Query($args);

                while ($tt_query -> have_posts()) : $tt_query -> the_post();
                $image = get_post_meta(get_the_ID(),'_cmb_client_image', true);
            ?>
        <div class="client-carousel">
            <div class="owl-carousel owl-theme">
                <div class="item">
                    <img width="170" height="131" src="<?php echo esc_url($image);?>" alt=""/>
                </div>
                <?php
                 endwhile;    wp_reset_postdata();
                 ?>
            </div>
        </div>
    </div>
</section>
<?php } if($type=='type2'){ ?>
<section class="client-2">
                <?php
                        $args = array(
                            'post_type' => 'tt-client',
                            'posts_per_page' => $number,
                            'order' => $orderpost,
                            'orderby' => $orderby,
                        );

                        $tt_query = new WP_Query($args);

                        while ($tt_query -> have_posts()) : $tt_query -> the_post();
                        $image = get_post_meta(get_the_ID(),'_cmb_client_image', true);
                    ?>
				<div class="single-client-box">
					<div class="icon-box">
						<img src="<?php echo wp_get_attachment_url( get_post_thumbnail_id());?>" alt="Awesome Image"/>
					</div>
					<div class="content">
						<h3><?php the_title();?></h3>
						<p><?php the_excerpt() ?></p>
					</div>
				</div>
				<?php endwhile;wp_reset_postdata();?>
</section>
<?php }