<?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 } ?>>

<article class="<?php echo p_sidebar(get_the_ID()); if ($az_data['sticky_side']) { echo ' pcol'; } ?>">
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <div role="main" class="scon" id="post-<?php the_ID(); ?>">
        <div class="s-product">
            <h1 class="post-title"><i aria-hidden="true" class="fas fa-pen-square"></i>
                <?php the_title(); ?>
            </h1>
            <div class="page-con">
                <?php the_content(); edd_az(); ?>
                <?php
                    $defaults = array(
                        'before'           => '<div class="text-center apage-break">',
                        'after'            => '</div>',
                        'link_before'      => '',
                        'link_after'       => '',
                        'next_or_number'   => 'text',
                        'separator'        => ' ',
                        'nextpagelink'     => '<span class="btn btn-primary">صفحه بعد <i aria-hidden="true" class="fas fa-angle-left"></i></span>',
                        'previouspagelink' => '<span class="btn btn-primary"><i aria-hidden="true" class="fas fa-angle-right"></i> صفحه قبل</span>',
                        'pagelink'         => '%',
                        'echo'             => 1
                    );
                    wp_link_pages($defaults);
                ?>
            </div>
        </div>
    </div>
    <?php endwhile;?>
    <?php if ( comments_open() ) : ?>
    <div class="comments-con">
        <div class="comments-list col-12">
            <?php comments_template(); ?>
        </div>
    </div>
    <?php endif; ?>
    <?php endif; ?>
</article>
<?php if((rwmb_meta( 'file_wside' ) != 1) && (rwmb_meta( 'file_wside' ) != 'noside')) { ?>
<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>
<?php } ?>

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

<?php get_footer(); ?>