<?php global $qaleb;?>
<?php if($qaleb['video-h-a']=='1'){?><a class="pwsmor" href="<?php echo $qaleb['video-h-l']; ?>">  آرشیو </a><?php } ?>
<div class="owl-carousel-1">
  <?php
			  
			  if($qaleb['video-h-content']=='1'){
				$arggs = array(
					'post_type' => 'video',
					'posts_per_page' => $qaleb['video-h-count'],
				);
			  }else if($qaleb['video-h-content']=='2'){
				$arggs = array(
					'post_type' => 'video',
					'posts_per_page' => $qaleb['video-h-count'],
					'orderby'	=> 	'rand'
				);
			  }else if($qaleb['video-h-content']=='3'){
				$arggs = array(
					'post_type' => 'video',
					'posts_per_page' => $qaleb['video-h-count'],
					'tax_query' => array(
                        array(
                            'taxonomy' => 'video_category',
                            'field'    => 'term_id',
                            'terms'    => $qaleb['video-h-type-select'],
                        ),
				    ),
				);
			  }
			  
            query_posts($arggs);
            if(have_posts()) : while(have_posts()) : the_post(); ?>
<div class="item">
<div class="thumbnail">
<?php if(has_post_thumbnail()){?>
<a href="<?php the_permalink(); ?>"><img src="<?php the_post_thumbnail_url('loop1'); ?>" alt="<?php the_title(); ?>"></a>
<?php }else{ ?>
<img src="<?php bloginfo("template_url"); ?>/img/none.png">
<?php } ?>
<a href="<?php the_permalink(); ?>" class="overlayy"><div class="textt"><i class="fa fa-youtube-play" aria-hidden="true"></i></div></a>
</div>
<div class="detbot">
<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php if(get_post_meta( get_the_ID(), 'video-time', true )!=null){ ?>
<div class="iico"><a href="<?php the_permalink(); ?>"><i class="fa fa-file-video-o"></i></a></div>
<div class="dato"><?php echo get_post_meta( get_the_ID(), 'video-time', true ); ?></div>
<?php } ?>
</div>
</div>
<?php endwhile; endif;  wp_reset_query(); ?>
</div>