controllers/home.php
$this->page_model->counter($this->data['post_detail']->post_ID);
$this->data['post_list'] = $this->post_model->post($this->data['post_detail']->post_ID);
$this->data['gallery_list'] = $this->post_model->post($this->data['post_detail']->post_ID, true);
$isAjax = array('news-post');
if (in_array($this->data['post_detail']->template_name, $isAjax))
{
if ( ! $this->input->is_ajax_request())
redirect($this->data['page_detail']->post_alias);
return $this->load->view($this->data['post_detail']->template_name, $this->data);
}
$this->load->view($this->data['post_detail']->template_name, $this->data);
views/news.php
<?php
$this->load->library('pagination');
$config['base_url'] = 'http://gsa-constructionspecialist.com/articles/article';
$config['total_rows'] = 14;
$config['per_page'] = 5;
$this->pagination->initialize($config);
?>
<div class="w626 content right">
<?php
if ($post_list){
foreach ($post_list as $pl){
?>
<div>
<p><br><br><strong><?php echo $pl->post_title; ?></strong></p>
<p><?php echo date('F jS, Y',strtotime($pl->post_date)); ?></p>
<br/>
<div style="text-align:justify"><?php echo word_limiter(strip_tags($pl->post_content),25); ?><a href="<?php echo site_url('articles/'.$this->uri->segment(2).'/detail/'.$pl->post_alias); ?>"><span style="color:#fff"> Read More ></span></a></div>
</div>
<?php } } ?>
<?php echo $this->pagination->create_links(); ?>
I am trying to set the pagination but it only appears on the bottom and it does not hide the articles that suppose to be on the next page.
Please help fix the codes? Thanks in advance.