<?php global $qaleb;?>
<?php if($qaleb['slider-3-ac'] == '1'){?>
<div class="slider-3">
<div class="container">
<div class="wrapper">
<div class="galleryt">
<div class="ap-slider_gallery clearfix">
<div class="ttit-t">
<h3><i class="fa fa-camera-retro" aria-hidden="true" style="font-size:17px"></i> <?php echo $qaleb['galleryt-title']; ?></h3>
<?php if($qaleb['galleryt-ar']=='1'){?><span class="read-more" tooltip="آرشیو کامل" flow="right"><a href="<?php echo $qaleb['galleryt-arl']; ?>"><i class="fa fa-folder-open-o" aria-hidden="true"></i></a></span><?php } ?>
</div>
<div class="polist">
  <?php
			  
			  if($qaleb['galleryt-content']=='1'){
				$arggs = array(
					'post_type' => 'gallery',
					'posts_per_page' => $qaleb['galleryt-count'],
				);
			  }else if($qaleb['galleryt-content']=='2'){
				$arggs = array(
					'post_type' => 'gallery',
					'posts_per_page' => $qaleb['galleryt-count'],
					'orderby'	=> 	'rand'
				);
			  }else if($qaleb['galleryt-content']=='3'){
				$arggs = array(
					'post_type' => 'gallery',
					'posts_per_page' => $qaleb['galleryt-count'],
					'tax_query' => array(
                        array(
                            'taxonomy' => 'gallery_category',
                            'field'    => 'term_id',
                            'terms'    => $qaleb['galleryt-type-select'],
                        ),
				    ),
				);
			  }
			  
            query_posts($arggs);
            if(have_posts()) : while(have_posts()) : the_post(); ?>
<article class="item">
<div class="thumbnail">
<?php if(has_post_thumbnail()){?>
<a href="<?php the_permalink(); ?>"><img src="<?php the_post_thumbnail_url('loop-3'); ?>"></a>
<?php }else{ ?>
<img src="<?php bloginfo("template_url"); ?>/img/none.png">
<?php } ?>
 </div>
<div class="det">
<?php if($qaleb['slider-3-dat'] == '1'){?><div class="time"><span><?php the_date('');  ?></span></div><?php } ?>
<h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
</div>
</article>
<?php endwhile; endif;  wp_reset_query(); ?>
</div>
</div>

</div><!---------gallerytt-------->

<div class="mediat">
<div class="ap-slider_media clearfix">
<div class="ttit-t">
<h3><i class="fa fa-video-camera" aria-hidden="true" style="font-size:17px"></i> <?php echo $qaleb['mediat-title']; ?></h3>
<?php if($qaleb['mediat-ar']=='1'){?><span class="read-more" tooltip="آرشیو کامل" flow="right"><a href="<?php echo $qaleb['mediat-arl']; ?>"><i class="fa fa-folder-open-o" aria-hidden="true"></i></a></span><?php } ?>
</div>
<div class="polist">
  <?php
			  
			  if($qaleb['mediat-content']=='1'){
				$arggs = array(
					'post_type' => 'media',
					'posts_per_page' => $qaleb['mediat-count'],
				);
			  }else if($qaleb['mediat-content']=='2'){
				$arggs = array(
					'post_type' => 'media',
					'posts_per_page' => $qaleb['mediat-count'],
					'orderby'	=> 	'rand'
				);
			  }else if($qaleb['mediat-content']=='3'){
				$arggs = array(
					'post_type' => 'media',
					'posts_per_page' => $qaleb['mediat-count'],
					'tax_query' => array(
                        array(
                            'taxonomy' => 'media_category',
                            'field'    => 'term_id',
                            'terms'    => $qaleb['mediat-type-select'],
                        ),
				    ),
				);
			  }
			  
            query_posts($arggs);
            if(have_posts()) : while(have_posts()) : the_post(); ?>
<article class="item">
<div class="thumbnail">
<?php if(has_post_thumbnail()){?>
<a href="<?php the_permalink(); ?>"><img src="<?php the_post_thumbnail_url('loop-3'); ?>"></a>
<?php }else{ ?>
<img src="<?php bloginfo("template_url"); ?>/img/none.png">
<?php } ?>
 </div>
<div class="det">
<?php if($qaleb['slider-3-dat'] == '1'){?><div class="time"><span><?php the_date('');  ?></span></div><?php } ?>
<h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
</div>
</article>
<?php endwhile; endif;  wp_reset_query(); ?>
</div>
</div>
</div><!---------mediat-------->

</div><!---------wrapper-------->
</div><!---------container-------->
</div><!---------slider-3-------->
<?php } ?>