having just started out with Kirby and PHP in general I’m stuck at a (probably) simple task.
I want to display a badge on blog articles that are less or equal to 5 days old.
Right now I have it set up like this, which is pretty lame:
<?php foreach ($entries as $entry): ?> <article> <?php if ($currentDate === $entry->date()->toDate('d.m.y')): ?> New <?php endif ?> </article> <?php endforeach ?>
$currentDate = date('d.m.y');
I tried following these instructions but with no success.
How can I display something if a date is today or up to five days ago?