# Always -\>first()

**URL:** <https://forum.getkirby.com/t/always-first/22698>\
**Category:** Questions\
**Tags:** v3\
**Created:** [June 26, 2021, 3:34pm UTC](https://forum.getkirby.com/t/always-first/22698 "2021-06-26T15:34:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marc22761](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@marc22761](https://forum.getkirby.com/u/marc22761)\
**Post date:** [June 26, 2021, 3:34pm UTC](https://forum.getkirby.com/t/always-first/22698/1 "2021-06-26T15:34:35Z")

</div>

All articles are class=“first”

Where is my failure?

```auto
 <?php foreach($page->children()->listed()->flip() as $article): ?>
            <article class="<?php e($article->first(), 'first') ?>">
                <div class="post-credits">
                    <p class="normal-font"><?php if($user = $article->author()->toUser()): ?>
                    <?= $user->firstname() ?> <?= $user->surname() ?>
                    <?php endif ?></p>
                    <p class="normal-font"><?= $article->date()->toDate('d.m.Y') ?></p>
                </div>
                <div class="post-title">
                    <div class="normal-font"><?= $article->title()->html() ?></div>
                </div>
                <div class="post-image">
                    <?php if ($image = $article->picture()->toFile() ) : ?>
                        <img src="<?= $image->url() ?>" class="img-fluid">
                    <?php endif; ?>
                </div>
                <div class="post-text">
                    <p><?= $article->text()->excerpt(300) ?></p>
                    <a href="<?= $article->url() ?>">Read more…</a>
                </div>
            </article>
        <?php endforeach ?>

```

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [June 26, 2021, 3:45pm UTC](https://forum.getkirby.com/t/always-first/22698/2 "2021-06-26T15:45:51Z")

</div>

`first()` is not page method, but a collection method, so you would have to compare the current $article object with the first object of your collection:

```auto
<?php
$articles = $page->children()->listed()->flip();
foreach ($articles as $article): ?>
            <article class="<?php e($article === $articles->first(), 'first') ?>">
            </article>
<?php endforeach ?>

```

---

<div class="post-metadata">

**Author:** ![marc22761](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@marc22761](https://forum.getkirby.com/u/marc22761)\
**Post date:** [June 26, 2021, 4:33pm UTC](https://forum.getkirby.com/t/always-first/22698/3 "2021-06-26T16:33:34Z")

</div>

Always right Sonja! 😉

Fixed, Working, Thanks!
