# Link multiples thumbnails to one project

**URL:** <https://forum.getkirby.com/t/link-multiples-thumbnails-to-one-project/30913>\
**Category:** Questions\
**Tags:** v3\
**Created:** [February 26, 2024, 3:40pm UTC](https://forum.getkirby.com/t/link-multiples-thumbnails-to-one-project/30913 "2024-02-26T15:40:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![petitjean](https://avatars.discourse-cdn.com/v4/letter/p/bc8723/32.png) [@petitjean](https://forum.getkirby.com/u/petitjean)\
**Post date:** [February 26, 2024, 3:40pm UTC](https://forum.getkirby.com/t/link-multiples-thumbnails-to-one-project/30913/1 "2024-02-26T15:40:51Z")

</div>

Hello everyone!  
I would like to create links between the thumbnails on the home page and the corresponding projects, but I can’t do it.  
Several thumbnails can redirect to the same project, such as the “le-travail-de-riviere” project.  
Thank you for your help.

PS: I don’t know if I posted my question in the right section of the forum.  
Sorry for the duplicate topic.

 ![Capture d’écran 2024-01-26 à 12.14.58](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/1/1063b21d0af2bf30d87b70fe9c0da0b9750881ec.png)  
 ![Capture d’écran 2024-01-26 à 12.15.25](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/4/4422a1c8ef969740597f3bc4e829ee52c94f0f7d.png)  
 ![Capture d’écran 2024-01-26 à 14.40.37](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/c/cd6b8bf5c8fdc4f753a842f5587f54c44c4f974f.png)  
 ![Capture d’écran 2024-01-26 à 14.41.53](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/f/f63223934ead661fb333f7c040ded7f8140b5283.jpeg)

---

<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:** [February 26, 2024, 4:52pm UTC](https://forum.getkirby.com/t/link-multiples-thumbnails-to-one-project/30913/2 "2024-02-26T16:52:49Z")

</div>

The problem is with this line:

```auto
<?php if ($image = $thumb->images()): ?>

```

What you want there is to fetch all images and then loop through them:

```auto
<?php foreach ($page->children()->listed() as $child): ?>
  <?php foreach ($child->images() as $image): ?>
    <a href="<?= $child->url() ?>"><img src="<?= $image->url() ?>" alt=""></a>
<?php endforeach ?>
<?php endforeach ?>

```

Shortened, didn’t want to type out all the code.  
In the future, please post your code as code, for easy copy and amend. Thank you.

---

<div class="post-metadata">

**Author:** ![petitjean](https://avatars.discourse-cdn.com/v4/letter/p/bc8723/32.png) [@petitjean](https://forum.getkirby.com/u/petitjean)\
**Post date:** [February 27, 2024, 6:47am UTC](https://forum.getkirby.com/t/link-multiples-thumbnails-to-one-project/30913/3 "2024-02-27T06:47:29Z")

</div>

Thanks a lot for you answer, it does work!  
I understand my error.  
Yes I’am sorry, for next time, I will post my code as code, I promise.  
Bye!
