sort gallery

Hello,

I have the following gallery in use.

https://tutorialzine.com/2013/05/diagonal-fade-gallery

? 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: https://stackoverflow.com/a/2667105