I’m using get_pages() function to get all subpages from a page like this:
$childrens = get_pages(array('child_of' => 7,
'sort_column' => 'post_date',
'sort_order' => 'DESC',
'depth' => -1));
This is supossed to get me a list of all pages (no matter if direct children, children of children, etc) orderen by the date they were created, but instead its showing me the list of pages in a strange order, here’s the output when I run a foreach on the $childrens array and output the post_date on each:
2011-05-10 15:37:03
2011-05-10 15:35:59
2011-05-10 15:01:18
2011-05-10 17:12:32
2011-05-10 15:00:47
2011-05-10 14:00:14
2011-05-11 04:19:08
2011-05-10 23:52:54
2011-05-10 15:20:12
2011-05-10 15:05:10
As you can see they’re not ordered by date descending, I tried using other options in the sort_column key but none seemed to e working correctly, does anyone know what could be wrong?
Thanks in advance!