I’m using the Kirby Starterkit to develop a new website for our studio. Upon trying to view several blog posts, I am getting an error I don’t understand: Call to a member function url() on null
. The error is in the following line, with the <img>
tag:
<?php if($item->coverimage()->isNotEmpty()): ?>
<figure>
<img src="<?= $item->coverimage()->toFile()->url() ?>" alt="" />
</figure>
<?php endif ?>
The offending blog post has this as its cover image.
----
Coverimage: 20161011-INTRO-0904.jpg
----
Strangely, viewing the individual blog post works just fine.
How can I debug this?