<?php
/*
Theme Designed By: S O R O U S H M A R K E T
Email: info@soroushmarket.ir
Demo Website: soroushmarket.ir
Author Website: soroushmarket.ir
*/
  get_header();?>
   <div role="complementary" class="col-lg-3 col-md-3 col-sm-12 hidden-sm hidden-xs side-bar">
   <?php get_template_part('right-sidebar'); ?>
   </div>
<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
   <?php if ( have_posts() ) : ?>
   <?php while ( have_posts() ) : the_post(); ?>
    <?php if ($data['view_type'] == 1) { ?>
   <div role="main" class="col-lg-6 col-md-6 col-sm-6 col-xs-12 pcon" id="post-<?php the_ID(); ?>">
      <div class="product">
         <div class="col-lg-4 col-md-5 col-sm-5 col-xs-12 prod-img fr-img">
            <?php if ( has_post_thumbnail()) :  ?>
            <a href="<?php the_permalink() ?>" class="vi-img-res-box"><?php the_post_thumbnail( 'thumbnail' ); ?></a>
            <?php else: ?>
            <a href="<?php the_permalink() ?>" class="vi-img-res-box"><img src="<?php echo esc_url( get_template_directory_uri() ); ?>/images/tumb.png" class="post-tumb"/></a>
            <?php endif; ?>
         </div>
         <div class="col-lg-8 col-md-7 col-sm-7 col-xs-12 prod-det">
            <div class="row prod-name">
               <h2><?php the_title(); ?></h2>
            </div>
            <?php if(function_exists('edd_price')) { ?>
            <div class="row prod-price price">
               <i class="fa fa-database price-icon"></i>
               <?php if(edd_is_free_download(get_the_ID()) && $data['free_price'] == 1) { 
                                echo 'رایگان';
                           } else {edd_price(get_the_ID());}
                              ?>
            </div>
            <?php } ?>
            <div class="prod-links">
               <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                  <a href="<?php the_permalink() ?>" class="col-lg-11 col-md-11 col-sm-11 col-xs-12 btn btn-success btn-sm prod-btn">
                  <span class="fa fa-list"></span>&nbsp;&nbsp;توضیحات
                  </a>
               </div>
               <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                  <?php if(function_exists('edd_price')) { 
                   if(edd_is_free_download($post->ID) && is_plugin_active( 'easy-digital-downloads-free-link/easy-digital-downloads-free-link.php' )) { ?> 
                     <a href="<?php the_permalink() ?>" class="edd_free_link button blue col-lg-11 col-md-11 col-sm-11 col-xs-12 btn btn-primary btn-sm">
                     <span class="download-label">دانلود</span>
                  </a>
                 <?php } else {
                  echo edd_get_purchase_link(get_the_ID(), 'Add', 'button');
                  } }?>
               </div>
            </div>
         </div>
      </div>
   </div>
   <?php } else { ?>
   <div role="main" class="col-lg-4 col-md-4 col-sm-4 col-xs-12 pcon" id="post-<?php the_ID(); ?>">
      <div class="product">
         <div class="col-xs-12 prod-img fr-img">
            <?php if ( has_post_thumbnail()) :  ?>
            <a href="<?php the_permalink() ?>" class="vi-img-res-box"><?php the_post_thumbnail( 'single-download' ); ?>
            <?php else: ?>
            <a href="<?php the_permalink() ?>" class="vi-img-res-box"><img src="<?php echo esc_url( get_template_directory_uri() ); ?>/images/tumb.png" class="post-tumb"/>
            <?php endif; ?>
            <?php if(function_exists('edd_price')) { ?>
            <div class="row prod-price price pt-price">
               <i class="fa fa-database price-icon"></i>
               <?php if(edd_is_free_download(get_the_ID()) && $data['free_price'] == 1) { 
                                echo 'رایگان';
                           } else {edd_price(get_the_ID());}
                              ?>
            </div>
            <?php } ?>
            </a>
         </div>
         <div class="col-xs-12 prod-det">
            <div class="col-xs-10 prod-name pt-name">
               <h2 title="<?php the_title(); ?>"><?php the_title(); ?></h2>
            </div>
            <div class="col-xs-12 prod-links pt-link">
               <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                  <a href="<?php the_permalink() ?>" class="col-lg-11 col-md-11 col-sm-11 col-xs-12 btn btn-success btn-sm prod-btn">
                  <span class="fa fa-list"></span>&nbsp;&nbsp;توضیحات
                  </a>
               </div>
               <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                  <?php if(function_exists('edd_price')) { 
                   if(edd_is_free_download($post->ID) && is_plugin_active( 'easy-digital-downloads-free-link/easy-digital-downloads-free-link.php' )) { ?> 
                     <a href="<?php the_permalink() ?>" class="edd_free_link button blue col-lg-11 col-md-11 col-sm-11 col-xs-12 btn btn-primary btn-sm">
                     <span class="download-label">دانلود</span>
                  </a>
                 <?php } else {
                  echo edd_get_purchase_link(get_the_ID(), 'Add', 'button');
                  } }?>
               </div>


            </div>
         </div>
      </div>
   </div>
   <?php } ?>
   <?php endwhile; ?>
   <div class="col-lg-12 pagination">
      <?php wp_pagination(); ?>
   </div>
   <?php else : ?>
   <div class="col-lg-12">
      <div class="alert alert-warning alert-dismissible anote" role="alert">
         <strong><span class="glyphicon glyphicon-bell" aria-hidden="true">
         </span> فایلی پیدا نشد.</strong>
      </div>
   </div>
   <?php endif; ?>
</div>
</div>
 <?php if ($data['show_side_mobile'] == 1) { ?>
 <div role="complementary" class="col-lg-3 col-md-3 col-sm-12 visible-sm visible-xs side-bar">
   <?php get_template_part('right-sidebar'); ?>
 </div>
 <?php } ?>
</div>
<?php get_footer(); ?>