<?php require_once("blog.php"); 
require_once("common_slug_functions.php"); // ✅ added?>

<!doctype html>

<html lang="en">

<head>
<title>Blog on TEFL/TESOL</title>
<meta name="title" content="Blog on TEFL/TESOL"/>
<meta name="description" content="Read our exclusive blogs that cover everything that you need to know about TEFL and TESOL. Expand your knowledge and learning">
<meta name="robots" content="noodp,noydir" />
<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1">



<?php include("common/header-script.php"); ?>

<link rel="canonical" href="https://www.teflcoursethailand.com/blog/" />

</head>

<body class="yl-home">

<!-- HEADER -->

  <?php include("common/header.php"); ?>

<!-- HEADER END --> 





<section  id="blog" class="container" style="margin-top:20px;">



<div class="blog">



<div class="row">

<div id="content-area" class="col-md-9">

<?php  for($i=0; $i<$no_of_blogs; $i++)  {  ?>

  	

	<?php $blog_title_org[$i] = $blog_title[$i];

	  // $blog_title[$i] = str_replace("-","",$blog_title[$i]);

	  // $blog_title[$i] = str_replace(" ","-",$blog_title[$i]); 

	  // $blog_title[$i] = str_replace("&","-",$blog_title[$i]); 

	  // $blog_title[$i] = str_replace("(","",$blog_title[$i]); 

	  // $blog_title[$i] = str_replace(")","",$blog_title[$i]); 

	  // $blog_title[$i] = str_replace("?","",$blog_title[$i]);

	  // $blog_title[$i] = str_replace(":","",$blog_title[$i]);

	  // $blog_title[$i] = str_replace("'","",$blog_title[$i]);

	  // $blog_title[$i] = str_replace("!","",$blog_title[$i]);

    /* ✅ REPLACED ALL str_replace WITH FUNCTION */
      $blog_title[$i] = createSlug($blog_title[$i]);

   ?>

<div class="blog-item">      

<div class="row">



<div class="col-md-12 blog-content">



  <?php if($blog_image_path[$i] != "")  {  ?>

   <?php $image_path = substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);?>

   <img src="https://www.teachertrainingasia.com/admin_tta/blog_image/<?php echo basename($blog_image_path[$i]);  ?>" class="img-responsive">

   <?php  }  ?>

   <br>

	<h3><a href="<?php echo $blog_id[$i]; ?>-<?php echo str_replace(" ","",$blog_title[$i]); ?>-blog.php" style="font-weight:bold;"> <?php echo $blog_title_org[$i]; ?></a> </h3>

<span id="publish_date"> &nbsp;<?php date_default_timezone_set("Asia/Kolkata"); echo date("jS F Y",strtotime($posting_dt[$i])); ?></span><br>





<span class="body-text">

   <?php if($blog_pre_desc[$i] == "") {

      $text = str_ireplace('<p>','<br>',substr(strip_tags($blog_desc[$i]),0,500));  $text = str_ireplace('</p>','',$text); 

      //echo "Pre Desc";

      }

      else {

      $text = str_ireplace('<p>','<br>',$blog_pre_desc[$i]);  $text = str_ireplace('</p>','',$text);

      //echo "Post Desc";

      } ?>

	<?php echo $text ?> ... </span>

   <br/>

   <div class="clearfix"></div>

   <br>

     <?php if($written_by[$i]!=""){ ?><b>Written By :</b> <?php echo $written_by[$i]; ?><?php } ?>

  <br><br>

    <a class="btn btn-primary pull-right" href="<?php echo $blog_id[$i]; ?>-<?php echo str_replace(" ","",$blog_title[$i]); ?>-blog.php"><span style="font-weight:bold;">Read More</span></a>



    <div class="clearfix"></div><br>

 

</div>

</div>

</div>

 

                                   

   <?php  }//end of loop for $i  ?>

 <!--PAGINATION START-->

        	<div class="paginate wrapper"><!-- The "wrapper" is just a comestic addition. You don't need this for the pagination to work. -->

                <ul>

                    <li><a href="./">First</a></li>

                    <li><a <?php if($page == 1) { ?>href="./" <?php } else { ?> href="./?page=<?php echo $page-1; ?>" <?php } ?>>Prev</a></li>

                    

                    <?php  for ($x=$s; $x<=$e; $x++) {  //echo $page; echo $i; ?>

                    <li><a <?php if($page == $x) { ?> class="active" <?php } else { ?> class="inactive" <?php } ?><?php if($x == 1) { ?> href="./" <?php } else { ?> href="./?page=<?php echo $x; ?>" <?php } ?> ><?php echo $x; ?></a></li>

                    <?php  }  ?>

                    

                    <!--<li><a href="" class="more">&hellip;</a></li>-->

                    <li><a <?php if($page == $total_pages) { ?>href="./?page=<?php echo $total_pages; ?>" <?php } else { ?> href="./?page=<?php echo $page+1; ?>" <?php } ?>>Next</a></li>

                    <li><a href="./?page=<?php echo $total_pages; ?>">Last</a></li>

                </ul>

            </div>

            

            <!--PAGINATION END-->



</div>

<div class="col-md-3">

<?php include('common/sidebar.php');?>

</div> 

</div><!--end row-->

</div><!--end container-->

</section>



 

       

<!--Body content Part End-->



  <?php include("common/footer.php"); ?>

  <?php include("common/footer-script.php"); ?>

