Forum

Thread tagged as: Problem, Blog

Unable to sort post by datetime

Hi

I am trying to sort my blog posts by recent first. I tried doing this with my code:

<?php
    perch_blog_custom(array(
        'template' => 'news-page-list.html',
        'sort' => 'postDateTime',
        'sort-order' => 'ASC'
    ));
?>

The site seems to sort the posts by blogTitle only.

Vaneza Mae Aumento

Vaneza Mae Aumento 0 points

  • 3 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

If you want the newest at the top you need to sort in descending order - DESC.