<?php get_header(); ?>
<?php global $qaleb;?>
<?php if($qaleb['gallery-slider'] == '1'){ ?>
<div class="clearfix"></div>
<div class="main_camera">
<div class="container inn">
<div class="ap_slider">
<div class="item clearfix">
  <?php
			  
			  if($qaleb['gallery-content']=='1'){
				$arggs = array(
					'post_type' => 'gallery',
					'posts_per_page' => 5,
				);
			  }else if($qaleb['gallery-content']=='2'){
				$arggs = array(
					'post_type' => 'gallery',
					'posts_per_page' => 5,
					'orderby'	=> 	'rand'
				);
			  }else if($qaleb['gallery-content']=='3'){
				$arggs = array(
					'post_type' => 'gallery',
					'posts_per_page' => 5,
					'tax_query' => array(
                        array(
                            'taxonomy' => 'gallery_category',
                            'field'    => 'term_id',
                            'terms'    => $qaleb['gallery-type-select'],
                        ),
				    ),
				);
			  }
			  
            query_posts($arggs);
            if(have_posts()) : while(have_posts()) : the_post(); ?>	

<div class="thumbnail">
<?php if(has_post_thumbnail()){?>
<a href="<?php the_permalink(); ?>"><img src="<?php the_post_thumbnail_url('slider'); ?>" alt="<?php the_title(); ?>"></a>
<?php }else{ ?>
<img src="<?php bloginfo("template_url"); ?>/img/none.png">
<?php } ?>
<div class="det">
<div class="met">
<span class="cat"><i class="fa fa-clock-o" aria-hidden="true"></i> <?php echo wt_time_ago(); ?> قبل</span>
</div>
<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
</div>
 </div>
<?php endwhile; endif;  wp_reset_query(); ?>
</div>

<div class="item clearfix">
<?php
			  
			  if($qaleb['gallery-content']=='1'){
				$arggs = array(
					'post_type' => 'gallery',
					'posts_per_page' => 5,
					'offset' => 5,
				);
			  }else if($qaleb['gallery-content']=='2'){
				$arggs = array(
					'post_type' => 'gallery',
					'posts_per_page' => 5,
					'offset' => 5,
					'orderby'	=> 	'rand'
				);
			  }else if($qaleb['gallery-content']=='3'){
				$arggs = array(
					'post_type' => 'gallery',
					'posts_per_page' => 5,
					'offset' => 5,
					'tax_query' => array(
                        array(
                            'taxonomy' => 'gallery_category',
                            'field'    => 'term_id',
                            'terms'    => $qaleb['gallery-type-select'],
                        ),
				    ),
				);
			  }
			  
            query_posts($arggs);
            if(have_posts()) : while(have_posts()) : the_post(); ?>	
<div class="thumbnail">
<?php if(has_post_thumbnail()){?>
<a href="<?php the_permalink(); ?>"><img src="<?php the_post_thumbnail_url('loop-bar'); ?>" alt="<?php the_title(); ?>"></a>
<?php }else{ ?>
<img src="<?php bloginfo("template_url"); ?>/img/none.png">
<?php } ?>
<div class="det">
<div class="met">
<span class="cat"><i class="fa fa-clock-o" aria-hidden="true"></i> <?php echo wt_time_ago(); ?> قبل</span>
</div>
<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
</div>
 </div>
<?php endwhile; endif;  wp_reset_query(); ?>	
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
<?php } ?>

<section class="ap_main">
<div class="container inn">
<div class="boxx">
<div class="tit">
<h4><span><?php the_archive_title(); ?></span></h4>
</div>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="mediaa">	
<div class="thumbnail">
<?php if(has_post_thumbnail()){?>
<a href="<?php the_permalink(); ?>"><img src="<?php the_post_thumbnail_url('loop'); ?>" alt="<?php the_title(); ?>"></a>
<?php }else{ ?>
<img src="<?php bloginfo("template_url"); ?>/img/none.png">
<?php } ?>
<span class="metaha medat"><i class="fa fa-clock-o" aria-hidden="true"></i> <?php the_time('d F Y - G:i');  ?></span>
	<div class="mask-img"></div>
	<div class="meicon"><i class="fa fa-camera"></i></div>
</div>
<h2><a href="<?php the_permalink(); ?>" alt="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
</div>
   <?php endwhile;
				else:
				echo "<b>چیزی یافت نشد !</b>";
				 endif; ?>
</div></div>			 
<div class="container inn"><?php numeric_posts_nav(); ?></div>	
</section>
<style>.marquee{background: #333;}.marquee-frame span a{color:#ddd !important}.slick-arrow.button-next,.slick-arrow.button-prev{display: none !important;}.main_camera{padding-top:30px;margin-top:-20px;margin-bottom:20px;}.content h1{margin-top:0;}</style>
<?php get_footer(); ?>