<?php if (ot_get_option('advertising_area_title') || ot_get_option('advertising_area') ): ?>
<div class="container advertising_area p-0">
  <div class="row">
    <div class="col-sm-12">
      <h4 class="title_single"><?php echo ot_get_option('advertising_area_title', __('بخش تبلیغات', 'leora')); ?></h4>
    </div>
    <div class="col-12">
        <div class="sin-content">
            <?php echo ot_get_option('advertising_area', __('محل قرار گیری بنر و متن تبلیغات یکتانت و ... شما میتوانید این بخش را از قسمت پنل قالب ویرایش کنید.', 'leora')); ?>
        </div>
    </div>
  </div>
</div>
<?php endif; ?>

<div class="container related-posts par_0">
  <div class="row">
    <div class="col-sm-12">
      <h4 class="title_single"><?php _e('Related posts', 'leora'); ?></h4>
    </div>
    <?php
      $numbercountpagesingle  = ot_get_option('content_post_number_related', false);
      $orig_post = $post;
      global $post;
      $categories = get_the_category($post->ID);
      if ($categories) {
      $category_ids = array();
      foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
      $args=array(
      'category__in' => $category_ids,
      'post__not_in' => array($post->ID),
      'posts_per_page' =>  $numbercountpagesingle,
      'gnore_sticky_posts'=>1
      );
      $my_query = new wp_query( $args );
      if( $my_query->have_posts() ) { while( $my_query->have_posts() ) {
      $my_query->the_post();?>
        <div class="col-6 col-md-4 pal_0">
          <div class="related-item posts-lists">
            <a href="<?php the_permalink(); ?>">
              <div class="rel-thumbnail">
                <a href="<?php the_permalink(); ?>">
                  <?php the_post_thumbnail('thumb5'); ?>
                </a>
              </div>
              <figcaption>
                <?php the_title() ?>
                <span class="post-time">
                  <?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . ' پیش'; ?>
                </span>
              </figcaption>
            </a>
          </div>
        </div>
    <?php
      }
    }
  }
  $post = $orig_post;
  wp_reset_query(); ?>
  </div>
</div>
