     <div class="tp-page-title-area pt-180 pb-185 position-relative fix" data-background="<?php echo $categoriesDataCheck['banner']; ?>">
            <div class="tp-custom-container">
                <div class="row">
                    <div class="col-12">
                        <div class="tp-page-title z-index">
                            <h2 class="breadcrumb-title"> <span><?php echo $categoriesDataCheck['title']; ?></span></h2>
                            <div class="breadcrumb-menu">
                                <nav class="breadcrumb-trail breadcrumbs">
                                    <ul class="trail-items">
                                        <li class="trail-item trail-begin"><a href="<?php echo $generalSettingCheck['site_url']; ?>"><?php echo $langArray['LINK_HOME']; ?></a>
                                        </li>
                                        <li class="trail-item trail-end"><span><?php echo $categoriesDataCheck['title']; ?></span></li>
                                    </ul>
                                </nav>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <section class="blog-sidebar-area pt-120 pb-110">
            <div class="container">
                <div class="tp-custom-container-box">
                    <div class="row">
                        <div class="col-lg-9">
                            <div class="ablog__sidebar--wrapper mr-50">
                                <?php
          $totalData = $db->query("SELECT COUNT(*) FROM posts WHERE FIND_IN_SET({$categoriesDataCheck['categories_id']},categories)")->fetchColumn();
          $show = 99999;
          $totalPage = ceil($totalData / $show);
          $page = @$_GET["p"];
          if($page < 1) $page = 1;
          if($page > $totalPage){
            $page = (int)$totalPage;
          }
          $limit = ($page - 1) * $show;
          $data = $db->prepare("SELECT * FROM posts WHERE FIND_IN_SET({$categoriesDataCheck['categories_id']},categories) LIMIT :basla, :bitir");
          $data->bindValue(":basla",$limit,PDO::PARAM_INT);
          $data->bindValue(":bitir",$show,PDO::PARAM_INT);
          $data->execute();
          $sequence = $data->fetchAll(PDO::FETCH_OBJ);
          if ($sequence == null) {
           echo '
           <div class="col-sm-12">
             <span class="alert alert-danger block">'.$langArray['NO_CONTENT'].'</span>
           </div>
           ';
          }
          foreach ($sequence as $item){
            $x = explode("/", $item->banner);
            $y = explode('.', $x[1]);
        ?>
                                <div class="ablog ablog-4 mb-55 wow fadeInUp" data-wow-delay=".4s">
                                    <div class="ablog__img">
                                        <img src="<?php echo $item->banner;?>" class="img-fluid" alt="img">
                                    </div>
                                    <div class="ablog__text ablog__text4">
                                       
                                        <h3 class="ablog__text--title4 mb-20"><a href="<?php echo $item->seo_url;?>"><?php echo $item->title;?></a></h3>
                                        <p class="mb-30"><?php echo strip_tags(shorter($item->content, 350)); ?></p>
                                        <div class="ablog__btn4">
                                            <a href="<?php echo $item->seo_url;?>" class="theme-btn"><i class="flaticon-enter"></i><?= $langArray['READ_MORE']; ?></a>
                                        </div>
                                    </div>
                                </div><?php } ?>
                               
                            </div>
                        </div>
                        <div class="col-lg-3">
                            <div class="ablog__sidebar">
                            
                              

                                <div class="widget mb-40 wow fadeInUp"  data-wow-delay=".7s">
                                    <h3 class="sidebar__widget--title mb-25"><?php echo $langArray['HEAD_CATEGORIES']; ?></h3>
                                    <div class="sidebar--widget__cat mb-20">
                                         <?php
             $allCategories = array();
             $allCatCheck=$db->query("SELECT * FROM categories where language={$getLangCheck['language_id']} and categories_type='post_categories'", PDO::FETCH_ASSOC);
             if ( $allCatCheck->rowCount() ){
               foreach( $allCatCheck as $line ){
                  $allCategories[$line['categories_id']]['categories_id'] = $line['categories_id'];
                  $allCategories[$line['categories_id']]['title'] = $line['title'];
                  $allCategories[$line['categories_id']]['categories_top_id'] = $line['categories_top_id'];
                  $allCategories[$line['categories_id']]['seo_url'] = $line['seo_url'];
               }
             }
             function findCategories($categories){
                $row = array();
                foreach($categories as $category){
                  if($category['categories_top_id'] == 0) $row[] = $category;
                }
                return $row;
             }
             function findSubCategories($topCat,$categories,$again = 2){
                $row = array();
                foreach($categories as $category){
                  if($category['categories_top_id'] == $topCat){
                    $row[] = $category;
                  }
                }
                if(count($row) > 0){
                  foreach($row as $cat){
                    echo '<li><a href="'.$cat['seo_url'].'">'.str_repeat('- ',$again).' '.$cat['title'].'</a></li>';
                    findSubCategories($cat['categories_id'],$categories,$again+1);
                  }
                }
             }
             $mainCategories = findCategories($allCategories);
             echo '
               <ul class="blog-cat">
             ';
              foreach($mainCategories as $category){
                echo '
                 <li><a href="'.$category['seo_url'].'">'.str_repeat('- ',0).' '.$category['title'].'</a></li>
                ';
                findSubCategories($category['categories_id'],$allCategories);
              }
             echo '</ul>';
            ?>
                                    </div>
                                </div>
                              
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-12">
                            <div class="basic-pagination mt-10 wow fadeInUp"  data-wow-delay=".5s">
                                <ul>
                                     <?php for($i = 1; $i<=$totalPage;$i++){?>
              <li><a href="<?php echo $generalSettingCheck['site_url'] . $pageDataCheck['seo_url']; ?>?p=<?php echo $i;?>"><?php echo $i;?></a></li>
            <?php } ?>
                                    
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>