<?php global $qaleb;?>
<?php if($qaleb['slider-main-ac']=='1'){?>
<div class="ap_slider">
  <?php
			  
			  if($qaleb['slider-main-content']=='1'){
				$arggs = array(
					'post_type' => 'post',
					'posts_per_page' => $qaleb['slider-main-count'],
				);
			  }else if($qaleb['slider-main-content']=='2'){
				$arggs = array(
					'post_type' => 'post',
					'posts_per_page' => $qaleb['slider-main-count'],
					'orderby'	=> 	'rand'
				);
			  }else if($qaleb['slider-main-content']=='3'){
				$arggs = array(
					'post_type' => 'post',
					'posts_per_page' => $qaleb['slider-main-count'],
					'tax_query' => array(
                        array(
                            'taxonomy' => 'category',
                            'field'    => 'term_id',
                            'terms'    => $qaleb['slider-main-type-select'],
                        ),
				    ),
				);
			  }
			  
            query_posts($arggs);
            if(have_posts()) : while(have_posts()) : the_post(); ?>	
<div class="item clearfix">
<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>
<div class="det">
<div class="met">
<?php if(get_post_meta( get_the_ID(), 'meta-text-1', true )!=null){ ?><span class="cat"><?php echo get_post_meta( get_the_ID(), 'meta-text-1', true ); ?></span> <?php } ?>
</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>
<?php } ?>