Hello, I’m trying to place repeating images in random order.
Can I sort images in random order using ‘sort by’ ?
<?php foreach ($programsPage->children()->listed()->sortBy('num', 'asc') as $program): ?>
Hello, I’m trying to place repeating images in random order.
Can I sort images in random order using ‘sort by’ ?
<?php foreach ($programsPage->children()->listed()->sortBy('num', 'asc') as $program): ?>
If you sort stuff, the order is no longer random but sorted. So shuffle()
would probably be what you want.
Having said that, you are sorting pages here, not images?