<?php
/*
Theme Designed By: Meysam Hosseinkhani
Email: Meysam98@Gmail.com
Author Website: Hosseinkhani.ir
*/
   // Exit if accessed directly
   if (!defined('ABSPATH')) {
    exit;
} ?>
<div class="scon<?php global $az_data; if (!$az_data['show_slider_mobile']) { echo ' hidden-xs'; } ?>">
   <div class="slide-con">
      <?php
      $slides = $az_data['main_slider'];
      if(!empty($slides[0]['image'])) { ?>
      <div class="slider_container"> 
         <div class="slider owl-carousel" id="slider" data-itemnavs="true" data-itemplay="true" data-itemtime="8000">
            <?php 
               foreach ($slides as $slide) {
                  if(!empty($slide['image'])) {
                     echo '<div class="item">
                     <a href="'.$slide['url'].'" aria-label="'.$slide['title'].'"><img src="'.$slide['image'].'" alt="'.$slide['title'].'"></a>';
                     if ($slide['title'] != '') {
                     echo '<div class="caption hidden-xs">'.$slide['title'].'
                        <div class="desc">'.$slide['description'].'</div>
                     </div>';}
                     echo '</div>';
               } }
            ?>
         </div>
      </div>
      <?php } else { 
         echo 'لطفا ابتدا اسلایدی را از بخش تنظیمات پوسته اضافه نمایید.'; } ?>
   </div>
</div>