Skip to content

Commit

Permalink
add order by filter for blog
Browse files Browse the repository at this point in the history
  • Loading branch information
Noushid committed Jul 7, 2017
1 parent 2ab53e5 commit d3ebd00
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions application/controllers/Home.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ public function tds($page = 'tds')
}
/*gst sub-menu end*/

public function blog($pagnate="")
public function blog()
{
$page = 'blog';
$total_post = $this->blog->count_rows();
$data['blog'] = $this->blog->with_file()->with_document()->paginate(5, $total_post);
$data['blog'] = $this->blog->with_file()->with_document()->order_by('id','desc')->paginate(5, $total_post);
$data['all_pages'] = $this->blog->all_pages;

$this->load->view($this->header,['current' => 'Our Blog']);
Expand All @@ -129,15 +129,15 @@ public function contact($page = 'contact')

public function _load_testimonial()
{
return $this->testimonial->with_file()->get_all();
return $this->testimonial->with_file()->order_by('id','desc')->get_all();
}

public function _load_blog($limit ="")
{
if ($limit != "") {
return $this->blog->with_file()->with_document()->limit($limit)->get_all();
return $this->blog->with_file()->with_document()->limit($limit)->order_by('id','DESC')->get_all();
} else {
return $this->blog->with_file()->with_document()->get_all();
return $this->blog->with_file()->with_document()->order_by('id','desc')->get_all();
}
}

Expand Down

0 comments on commit d3ebd00

Please sign in to comment.