How to change display order of Listed pages?

Hi all,

I’m trying to create a directory on my website, where each page that will appear there is listed in the filesystem by date: “20210401_postname,” “20231202_postname,” etc. and would like the list to display the most recent pages at the top and the oldest at the bottom. This is the code for the list itself:

        <ul>
            <?php foreach ($page->children()->listed() as $item): ?>
            <a class="green" <?php e($item->isOpen(), 'aria-current="page"') ?> href="<?= $item->url() ?>"><li><?= $item->title()->esc() ?></li></a>
            <?php endforeach ?>
        </ul>

but of course by default it will just list as smallest number to largest number.
any and all help much appreciated :slight_smile:

You can simply flip the order:

$page->children()->listed()->flip()

perfect!!! Thanks so much for your help : )