Prevent showing of future articles


For my Kirby blog I would like to pre-publish articles, and having them show up as soon as the future date arrives.

I use dates in the sorting of my content folder:


and also as field within my articles:

Date: 2016-05-28

Currently I go through my articles like this:

<?php foreach ($page->children()->visible()->sortBy('date','desc') as $p): ?>

Could I add something like this in the chain above?



1 Like

Add ->filterBy('date', '<=', time()) :wink: where β€˜date’ is the name of the date field.

1 Like