<?php
/*
Theme Designed By: Meysam Hosseinkhani
Email: Meysam98@Gmail.com
Author Website: Hosseinkhani.ir
*/
   // Exit if accessed directly
   if ( ! defined( 'ABSPATH' ) ) exit;
 get_header();?>

<div class="container-fluid main-con">
    <main class="container">

    <?php azin_bread(); ?>
        
      <div class="row main<?php side_type(); ?>" id="main" <?php if ($az_data['site_schema']) { ?>itemscope itemtype="https://schema.org/Blog" <?php } ?>>

<div class="col-lg-9 col-12<?php if ($az_data['side_type'] == 2) { echo ' right-side'; } if ($az_data['sticky_side']) { echo ' pcol'; }?>">
    <?php if ( have_posts() ) : ?>
    <div class="row">
    <?php while ( have_posts() ) : the_post();
      if (get_post_type() == 'download') { ?>
    <article role="main" class="col-md-4 col-6 pcon" id="post-<?php the_ID(); ?>">
        <a href="<?php the_permalink() ?>" class="vi-img-res-box">
            <div class="product">
                <div class="post-img">
                    <div class="post-icon">
                        <span class="price">
                            <?php posticon(get_the_ID()); ?></span>
                    </div>
                    <?php p_img(); ?>
                    <?php if(function_exists('edd_price')) { ?>
                    <div class="prod-price price pt-price">
                        <i class="fas fa-database price-icon"></i>
                        <?php p_price(get_the_ID()); ?>
                    </div>
                    <?php } ?>
                </div>
                <div class="col-12">
                    <div class="col-10 prod-name pt-name">
                        <h2 title="<?php the_title(); ?>">
                            <?php the_title(); ?>
                        </h2>
                    </div>
                </div>
                <?php if($az_data['show_excerpt']) { ?>
                <div class="col-12 pdesc">
                    <?php the_excerpt(); ?>
                </div>
                <?php } ?>
            </div>
        </a>
    </article>
    <?php } else { ?>
    <article role="main" class="col-md-4 col-6 pcon" id="post-<?php the_ID(); ?>">
        <a href="<?php the_permalink() ?>" class="vi-img-res-box">
            <div class="product">
                <div class="post-img">
                    <div class="post-icon">
                        <span class="price"><i class="fas fa-file-alt"></i>
                            <?php echo $az_data['text_more_text']; ?></span>
                    </div>
                    <?php p_img();
             edd_az(); ?>
                    <div class="prod-price price pt-price">
                        <i class="fas fa-calendar price-icon"></i>
                        <?php echo get_the_date('j F Y'); ?>
                    </div>
                </div>
                <div class="col-12">
                    <div class="col-10 prod-name pt-name">
                        <h2 title="<?php the_title(); ?>">
                            <?php the_title(); ?>
                        </h2>
                    </div>
                </div>
                <?php if($az_data['show_excerpt']) { ?>
                <div class="col-12 pdesc">
                    <?php the_excerpt(); ?>
                </div>
                <?php } ?>
            </div>
        </a>
    </article>
    <?php } ?>
    <?php endwhile; ?>
    <div class="col-12 pagination">
        <?php wp_pagination(); ?>
    </div>
    </div>
    <?php else : ?>
        <div class="alert alert-warning alert-dismissible anote" role="alert">
            <strong><span class="fas fa-bell" aria-hidden="true">
                </span>
                <?php echo $az_data['text_not_found']; ?></strong>
        </div>
    <?php endif; ?>
</div>
<aside class="col-lg-3 side-bar<?php if (!$az_data['show_side_mobile']) {echo ' hidden-sm hidden-xs';} if ($az_data['sticky_side']) { echo ' side-sticky'; }?>">
    <?php get_template_part('right-sidebar'); ?>
</aside>

</div>
</main>
</div>

<?php get_footer(); ?>