<?php 
if ( ! defined( 'ABSPATH' ) ) {
  die( '-1' );
}

/**
 * Shortcode attributes
 * @var $atts
 * @var $order
 * @var $orderby
 * @var $cat
 * @var $col
 * @var $i
 * @var $thumbsize
 * @var $content - shortcode content
 * Shortcode class
 * @var $this WPBakeryShortCode_qk_team
 */
$order =  $cat =  $thumbsize = $orderby = $i = '';

$output = $after_output = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
if(isset($cat) and $cat!='all'){
	$args = array('post_type' => 'portfolio', 'posts_per_page' => $order, 'tax_query' => array(
	array(
		'taxonomy' => 'portfolio_category',
		'field'    => 'slug',
		'terms'    => $cat,
	),
));
}else{
	$args = array('post_type' => 'portfolio', 'posts_per_page' => $order);
}	
$i==1;
$portfolio = new WP_Query($args);
?>

<!-- portfolio-split section -->
<section class="portfolio-split-section">
	<?php  while($portfolio->have_posts()) : $portfolio->the_post(); ?>
	<?php if($i%2==0){ ?>
	<div class="project-post right-align">
		<div class="title-post">
			<?php if( function_exists('get_simple_likes_button') ) echo get_simple_likes_button(get_the_ID());?>
			<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
			<?php echo get_the_term_list( get_the_ID(), 'portfolio_tag', '<ul class="project-tags"><li>', ',</li><li>', '</li></ul>' );?>
		</div>
		<div class="post-gallery">
			<?php the_post_thumbnail(); ?>
		</div>
	</div>
	<?php }else{ ?>
	<div class="project-post left-align">
		<div class="post-gallery">
			<?php the_post_thumbnail(); ?>
		</div>
		<div class="title-post">
			<?php if( function_exists('get_simple_likes_button') ) echo get_simple_likes_button(get_the_ID());?>
			<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
			<?php echo get_the_term_list( get_the_ID(), 'portfolio_tag', '<ul class="project-tags"><li>', ',</li><li>', '</li></ul>' );?>
		</div>
	</div>
	<?php } ?>
<?php $i++; endwhile; ?>


</section>
<!-- End portfolio-split section -->

