I am attempting to switch the order of my showcase thumbnails on my homepage from the default ascending order. On load, I would like it to display the thumbs on desc order.
I have implemented Isotope filters to add more filtering options if the user would like to see the content differently, but on load it must default to descending.
So far I have referenced the docs on sortBy() and added ‘desc’ in place of ‘asc’ but the page still loads with the same order, showing the first page I ever added as the first thumb. Is there something else I need to add in order to get it to be descending?
here is my showcase snippet:
<li class="showcase-item column">
<a href="<?= $project->url() ?>" class="showcase-link">
<?php if($image = $project->images()->sortBy('date', 'desc')->first()): $thumb = $image->crop(600, 600); ?>
<img src="<?= $thumb->url() ?>" alt="Thumbnail for <?= $project->title()->html() ?>" class="showcase-image" />
<?php endif ?>
<div class="showcase-caption">
<h3 class="name showcase-title"><?= $project->title()->html() ?></h3>
<h4 class="tags"><?= $project->tags()->html() ?></h4>
</div>
</a>
</li>