Loop children by category

First of all: I’m a total beginner, so please don’t be hard at me.
I would like to feature some of my products that are children of another site on my index page.
I created the tag ‘starter’.

What is the loop supposed to look like to show the children of the page ‘angebote’ filtered by the tag ‘starter’.

This is what I have but i cant manage to include the filter without getting an error.

<?php foreach($items = $pages->find('angebote')->children()->listed() as $item): ?>

Welcome to our community. We usually don’t bite :wink:

$featuredOffers = page('angebote')->children()->listed()->filterby('tag', 'starter', ',');
foreach ( $featuredOffers as $offer ) : ?>
  <!-- Code that goes into the loop -->
<?php endforeach; ?>

If your field is not called tag, change the parameter in the filterBy() method.

On a side note: It’s good practice to define your variables outside the foreach statement…

Thank you for helping me, that worked well. To be honst I never really learned to code from scratch, I’m just quite good at googling, understanding syntax and modifying code and somehow manage to solve most of my problems by doing that. But I should really change that in the future…

You can actually get quite far like that… so don’t worry.