I have a section of my website where I am trying to get the URL of the listed sibling page however it is linking to my sibling’s child. The same button I am trying to only display if there are more than 3 children in the listed sibling.
<?php foreach ($page->siblings()->listed() as $project): ?>
<h2>
<?= $project->title() ?>
</h2>
<?php foreach ($project->children()->limit(3) as $project): ?>
<div class=" background-image" style="background-image:url(<?= ($f = $project->image()) ? $f->url() : ''; ?>)">
</div>
<?php endforeach?>
<?php if ($page->siblings()->count() > 3):?>
<a href="<?= $project->url() ?>" >
See More
</a>
<?php endif ?>
<?php endforeach?>