Here’s how you can sort pages as they appear in the CMS when using the ProcessWire API. This is useful because if you aren’t using children()
the ordering of your pages won’t usually be correct.
wire('pages')->find('template=page, sort=sort')
The key part of the selector is the sort=sort
part.
