Forum

Thread tagged as: Question, Problem, Blog

Ordering blog post when using category filter

Is there a way to order the blog posts when using the category filter. Debug is telling me they are ordered by post title ASC - my client needs them ordered by date

Matthew Owen

Matthew Owen 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, you can use the sort option to do that.

in the backend, when logged in...

Simon Clay

Simon Clay 127 points

Hi,

I think you'd use something like this in your page:

<?php
perch_blog_custom(array(
    'category' => perch_get('cat'),
    'sort' => 'postDateTime',
    'sort-order' => 'DESC',
    'template' => 'your_blog_listing.html',
));
?>

Hi Simon, just to check we are not misunderstanding each other, I am referring to the Admin Area. My client needs to be able to find/sort the blog posts by category in order of date published. Standard appears to be post-title, ASC.

Thanks for your help!

Drew McLellan

Drew McLellan 2638 points
Perch Support

They should always be ordered by date. If not, that's a bug and we'll fix it.

ok, super. i will let my client know that it is being sorted - thank you!

Hi Drew, has this bug been fixed?

Drew McLellan

Drew McLellan 2638 points
Perch Support

No, it's something we'll look at for the next revision of Blog.