How to sort postings in processwire?

1

To sort the posts by date I did the following:

$posts = $pages->find('template=blog-post, start='.$start .', limit=' . $limit . ',sort=-date');

When I modify the code sort=-date and sort=date nothing is changed so I do not know what I'm doing wrong.

I'll make the rest of the code available link

I used this page to help solve this problem link

    
asked by anonymous 05.10.2015 / 10:37

1 answer

2

I solved the problem using the following code:

$posts = $pages->find('template=blog-post, start='.$start .', limit=' . $limit . ',sort=-created');
    
05.10.2015 / 10:48