<?php global $qaleb;?>
<?php if($qaleb['carousel-ac']=='1'){?>
<div class="clearfix"></div>
<section class="ap_main">
<div class="container inn">
<div class="main-top">
<div class="polist">
  <?php
			  
			  if($qaleb['carousel-content']=='1'){
				$arggs = array(
					'post_type' => 'post',
					'posts_per_page' => $qaleb['carousel-count'],
				);
			  }else if($qaleb['carousel-content']=='2'){
				$arggs = array(
					'post_type' => 'post',
					'posts_per_page' => $qaleb['carousel-count'],
					'orderby'	=> 	'rand'
				);
			  }else if($qaleb['carousel-content']=='3'){
				$arggs = array(
					'post_type' => 'post',
					'posts_per_page' => $qaleb['carousel-count'],
					'tax_query' => array(
                        array(
                            'taxonomy' => 'category',
                            'field'    => 'term_id',
                            'terms'    => $qaleb['carousel-type-select'],
                        ),
				    ),
				);
			  }
			  
            query_posts($arggs);
            if(have_posts()) : while(have_posts()) : the_post(); ?>
<div class="item">
<div class="head">
<div class="categorie"><span><?php the_time('d F');  ?></span></div>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
</div>
<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>
</div>
 <?php endwhile; endif;  wp_reset_query(); ?>
</div>
</div>
</div>
</section>
<?php } ?>