Calling last blog post in the homepage

hi all,
i am starting to use kirby 2.4 and now i have a problem:

i want to show my last blog post in the homepage, so i am trying to write something like this:

<?php foreach($site->find('blog')->children()->visible()->limit(1)) as $lastpost): ?>

but it seems in the new kirby this way to call the post is wrong, can someone help me? :wink:

The above won’t work, because you can’t loop through a single page object, only through a collection. In this way, limit(1) behaves in the same way as first().

<?php
$lastpost = $site->find('blog')->children()->visible()->limit(1);
echo $lastpost->title();
?>