Add content to the first item of my loop

Hey,
How can I add Content only to the first item of my loop?

  <?php foreach ($page->faq_entries()->toStructure() as $index => $entry) : ?>
  <div class="faq-entry" data-id="<?= $index ?>" id="faq-entry-<?= $index ?>">
  <div class="question">
     <h3><?= $entry->question() ?></h3>
  </div>
  <p class="answer"><?= $entry->answer()->kirbytextinline() ?></p>
   !!!!! Add Content for my FIRST Item here !!!!
  </div>
<?php endforeach ?>

Thank you so much! :slight_smile:

<?php if ($index === 0 ) {
  // do stuff here
}
?>
1 Like