<?php global $qaleb;?>
<?php if($qaleb['photo-h']=='1'){?>
<?php if($qaleb['photo-h-a']=='1'){?><a class="pwsmor" href="<?php echo $qaleb['photo-h-l']; ?>">  آرشیو </a><?php } ?>
<div class="owl-carousel-1">
  <?php
			  
			  if($qaleb['photo-h-content']=='1'){
				$arggs = array(
					'post_type' => 'photo',
					'posts_per_page' => $qaleb['photo-h-count'],
				);
			  }else if($qaleb['photo-h-content']=='2'){
				$arggs = array(
					'post_type' => 'photo',
					'posts_per_page' => $qaleb['photo-h-count'],
					'orderby'	=> 	'rand'
				);
			  }else if($qaleb['photo-h-content']=='3'){
				$arggs = array(
					'post_type' => 'photo',
					'posts_per_page' => $qaleb['photo-h-count'],
					'tax_query' => array(
                        array(
                            'taxonomy' => 'photo_category',
                            'field'    => 'term_id',
                            'terms'    => $qaleb['photo-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-camera"></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(), 'number-photo', true )!=null){ ?>
<div class="iico"><a href="<?php the_permalink(); ?>"><i class="fa fa-file-image-o"></i></a></div>
<div class="dato"><?php echo get_post_meta( get_the_ID(), 'number-photo', true ); ?></div>
<?php } ?>
</div>
</div>
<?php endwhile; endif;  wp_reset_query(); ?>
</div>
<?php } ?>