# {{ .range }} through specific folder

**URL:** <https://discourse.gohugo.io/t/range-through-specific-folder/27757>\
**Category:** Uncategorized\
**Created:** [August 22, 2020, 4:57pm UTC](https://discourse.gohugo.io/t/range-through-specific-folder/27757 "2020-08-22T16:57:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Milad\_Y](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/milad_y/32/12179_2.png) [@Milad\_Y](https://discourse.gohugo.io/u/Milad_Y)\
**Post date:** [August 22, 2020, 4:57pm UTC](https://discourse.gohugo.io/t/range-through-specific-folder/27757/1 "2020-08-22T16:57:27Z")

</div>

So I use `{{ range .Site.RegularPages }}` in my homepage to loop through blog posts, But this brings ALL the pages including the ones in the` /pages` folder which are not posts.

How can I only loop through ` /posts` section? What is the query?

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [August 22, 2020, 5:08pm UTC](https://discourse.gohugo.io/t/range-through-specific-folder/27757/2 "2020-08-22T17:08:38Z")

</div>

```auto
{{- range where .Site.RegularPages "Type" "posts" -}}

```

> **[where](https://gohugo.io/functions/where/#readout)**
>
> Filters an array to only the elements containing a matching value for a given field.

---

<div class="post-metadata">

**Author:** ![Milad\_Y](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/milad_y/32/12179_2.png) [@Milad\_Y](https://discourse.gohugo.io/u/Milad_Y)\
**Post date:** [August 22, 2020, 5:19pm UTC](https://discourse.gohugo.io/t/range-through-specific-folder/27757/3 "2020-08-22T17:19:26Z")

</div>

Thank you !

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [August 24, 2020, 5:19pm UTC](https://discourse.gohugo.io/t/range-through-specific-folder/27757/4 "2020-08-24T17:19:31Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
