<?php

$this->load->view('top'); 

$popular = $this->db->query("SELECT * FROM wps_blog WHERE article_id ORDER BY rand() LIMIT 20")->result_array();

?>

	<div class="page_breadcrumbs">

        <div class="container">

            <ul>

				<li><a href="<?php echo base_url(); ?>" title="Home">Home</a>

				</li>

				<li>Blogs</li>

            </ul>

        </div>

    </div>

	


 <section class="blog_page webpulse_tm_universal_title_holder">
  <div class="container">
    <div class="row">
      <div class="col-md-9">
        <div class="blog_left">
          <div class="title_holder_inner">
          <h1>Our Blog</h1>
            </div>
          <div class="row">
		  
			 <?php foreach ($res as $key => $val) { ?>
			 
				<div class="col-md-6 col-lg-6 col-sm-6 col-xs-12">
                  <div class="row">
                    <div class="col-md-12">
                      <aricle>
                        <div class="blog_grid">
                          <a href="<?php echo site_url($val['friendly_url']); ?>" title="<?php echo $val['article_title']; ?>">
                            <div class="image"><img src="<?php echo get_image_with_name($val['article_title'], 'blog', $val['article_image'], '382', '213', 'R'); ?>" alt="<?php echo $val['article_title']; ?>" title="<?php echo $val['article_title']; ?>"></div></a>
                          <div class="article_title ">
                            <hr class="article_line">
                            <h4 class="text-limit-100px"><a href="<?php echo site_url($val['friendly_url']); ?>" title="<?php echo $val['article_title']; ?>"><?php echo $val['article_title']; ?></a></h4>
                            <span class="article_category_name">
                              <a href="<?php echo site_url($val['friendly_url']); ?>" title="<?php echo $val['article_title']; ?>"><span>View Details</span></a>
                            </span>
                          </div>
                        </div>
                      </aricle>
                    </div>
                  </div>
                </div>
				<?php } ?>
                    
                 <div class="col-md-12 col-lg-12 col-sm-12 col-xs-12">
					<p class="paging"></p>
				</div>
             </div>
        </div>
      </div>
      <div class="col-md-3">
        <div class="left_sidebar">
            <div class="left_title1">Popular Post</div>
			
				<?php
              foreach($popular as $populars) {
                $friendly_url = str_ireplace(" ", "-", $populars['friendly_url']);
                ?>
               <div class="right_news">
					<a href="<?php echo base_url($friendly_url); ?>" title="<?php echo $populars['article_title']; ?>">
					  <div class="image">
						<img src="<?php echo get_image_with_name($populars['article_title'], 'blog', $populars['article_image'], '382', '213', 'R'); ?>" alt="<?php echo $populars['article_title']; ?>" title="<?php echo $populars['article_title']; ?>">
					  </div>
					</a>
					<h5><a href="<?php echo base_url($friendly_url); ?>" title="<?php echo $populars['article_title']; ?>"><?php echo $populars['article_title']; ?></a></h5>
				  </div>
			  <?php } ?>
                          
         </div>
      </div>
    </div>
  </div>
</section> 



<?php $this->load->view('bottom'); ?>