sort gallery


I have the following gallery in use.

? How to sort the pictures by date - new pictures at the top.

Comments 3

  • I see that you've found my tutorial! It is not hard to sort the photos. Add this after the glob statement in load.php:

    usort($files, function($a, $b) {
        return filemtime($b) - filemtime($a);

    I took this snippet from here: