Hi!..
this is my code and when I use “<?= $item->image()->resize(720) ?>”,
they said “Call to a member function resize() on null”…
how can I fix this…?
regards,
<?php
$tag = param('tag');
$works = page('works');
$items = null;
if ($works) {
$items = $works->children()->listed();}
if ($tag) {
$items = $items->filterBy('category', $tag, ',');
}
?>
<?php if ($works = page('works')): ?>
<?php if ($items && $items->isNotEmpty()): ?>
<?php foreach ($items->paginate(7) as $item): ?>
<figure>
<?= $item->image()->resize(720) ?>
</figure>
<?php endforeach ?>
<?php endif ?>
<?php endif ?>