# Blogposts in subfolders (year/month) don't show up

**URL:** <https://forum.getkirby.com/t/blogposts-in-subfolders-year-month-dont-show-up/10496>\
**Category:** Questions\
**Tags:** v2\
**Created:** [May 25, 2018, 2:57pm UTC](https://forum.getkirby.com/t/blogposts-in-subfolders-year-month-dont-show-up/10496 "2018-05-25T14:57:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![polyester](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@polyester](https://forum.getkirby.com/u/polyester)\
**Post date:** [May 25, 2018, 2:57pm UTC](https://forum.getkirby.com/t/blogposts-in-subfolders-year-month-dont-show-up/10496/1 "2018-05-25T14:57:32Z")

</div>

Hi there.

I have a `blog` folder with subfolders for years and months. But the articles inside the subfolders won’t show up on my blog-homepage.

My folder structure looks like this: blog/2018/05/20180525-my-blog-post

In my blog.php template i tried it this way …:  
`<?php foreach($page->children()->visible()->flip()->paginate(10) as $article): ?>`

… and that way:  
`<?php foreach($page->grandChildren()->visible()->flip()->paginate(10) as $article): ?>`

Can anyone point me in the right direction?

---

<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:** [May 25, 2018, 3:21pm UTC](https://forum.getkirby.com/t/blogposts-in-subfolders-year-month-dont-show-up/10496/2 "2018-05-25T15:21:55Z")

</div>

Children would be the pages inside blog, grandchildren the children inside the year folders, so you would have to go one level deeper.

I’d fetch the page index and filter by template:

```auto
$posts = $page->index()->visible()->filterBy('template', 'post'); //or whatever your template

```

---

<div class="post-metadata">

**Author:** ![polyester](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@polyester](https://forum.getkirby.com/u/polyester)\
**Post date:** [May 25, 2018, 6:44pm UTC](https://forum.getkirby.com/t/blogposts-in-subfolders-year-month-dont-show-up/10496/3 "2018-05-25T18:44:24Z")

</div>

Thx. You just saved my sanity.

---

<div class="post-metadata">

**Author:** ![macjaeger](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/macjaeger/32/4631_2.png) [@macjaeger](https://forum.getkirby.com/u/macjaeger)\
**Post date:** [January 11, 2022, 5:16pm UTC](https://forum.getkirby.com/t/blogposts-in-subfolders-year-month-dont-show-up/10496/4 "2022-01-11T17:16:43Z")

</div>

I just came across this, as I have the same issue. How would I have to embed that line in a foreach loop? In Kirby3, of course 😁.

Thanks in advance for your help,  
Stephan

---

<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:** [January 11, 2022, 5:52pm UTC](https://forum.getkirby.com/t/blogposts-in-subfolders-year-month-dont-show-up/10496/5 "2022-01-11T17:52:36Z")

</div>

> [@texnixe](#):
>
> `$posts = $page->index()->visible()->filterBy('template', 'post'); //or whatever your template`

```auto
$posts = $page->index()->listed()->filterBy('template', 'post'); //or whatever your template
foreach ($posts as $post) {
  // do stuff
}

```

```auto

```

---

<div class="post-metadata">

**Author:** ![macjaeger](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/macjaeger/32/4631_2.png) [@macjaeger](https://forum.getkirby.com/u/macjaeger)\
**Post date:** [January 12, 2022, 9:08am UTC](https://forum.getkirby.com/t/blogposts-in-subfolders-year-month-dont-show-up/10496/6 "2022-01-12T09:08:11Z")

</div>

Thanks a million! Works like a charm.

All the best,  
Stephan

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:22pm UTC](https://forum.getkirby.com/t/blogposts-in-subfolders-year-month-dont-show-up/10496/7 "2025-02-06T17:22:57Z")

</div>


