<?php global $qaleb;?>
<?php if($qaleb['sound-ac']=='1'){?> 
<div class="titleha"><?php echo $qaleb['relate-sound-title']; ?></div>
<div class="owl-carousel-1">
<?php
$categories = get_the_category();
$cats = array();
foreach ( $categories as $category ) { 
$cats[] = esc_attr( $category->term_id ); 
}
$args = new WP_Query(array(
'post_type' =>'sound',
'cat'	=> $cats,
'posts_per_page' => $qaleb['sound-related-count'],
'post__not_in' => array(get_the_ID()),
));
if($args->have_posts()) : while($args->have_posts()) : $args->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-volume-up" aria-hidden="true"></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(), 'time-sound', true )!=null){ ?>
<div class="iico"><a href="<?php the_permalink(); ?>"><i class="fa fa-file-audio-o"></i></a></div>
<div class="dato"><?php echo get_post_meta( get_the_ID(), 'time-sound', true ); ?></div>
<?php } ?>
</div>
</div>
<?php endwhile; endif;  wp_reset_query(); ?>
</div>
         <script>
            $(document).ready(function() {
              var owl = $('.owl-carousel-1');
              owl.owlCarousel({
                rtl: true,
                margin: 20,
                nav: true,
                loop: true,
                responsive: {
                  0: {
                    items: 1
                  },				  
                  400: {
                    items: 2
                  },				  				  				  				  
                  1300: {
                    items: 3
                  }
                }
              })
            })
          </script>
<?php } ?>	