ProcessWire
Recipes_

Find latest modified (sub)child of a page

Problem

A page has got a possibly deeply nested children structure and you want to get the latest modified child of that page.

Solution

$lastModifiedChild = $page->find("id>0,sort=-modified")->first;

Resources