# {{has}} helper doesn't return all the posts with a tag

**URL:** <https://forum.ghost.org/t/has-helper-doesnt-return-all-the-posts-with-a-tag/13672>\
**Category:** Developer help\
**Created:** [April 19, 2020, 5:17pm UTC](https://forum.ghost.org/t/has-helper-doesnt-return-all-the-posts-with-a-tag/13672 "2020-04-19T17:17:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![r3bl](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/r3bl/32/5009_2.png) [@r3bl](https://forum.ghost.org/u/r3bl)\
**Post date:** [April 19, 2020, 5:17pm UTC](https://forum.ghost.org/t/has-helper-doesnt-return-all-the-posts-with-a-tag/13672/1 "2020-04-19T17:17:46Z")

</div>

- What’s your URL? [https://input.sh](https://input.sh)
- What version of Ghost are you using? 3.13.3

In partials/musicLoop.hbs, I have this structure:

```auto
{{#foreach posts visibility="all"}}
{{#has tag="Music"}}
    <div>HTML code here</div>
{{/has}}
{{/foreach}}

```

Within my tags page, I see the following:

 ![Screenshot from 2020-04-19 19-12-49@2x](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/a/ae4ee6c36c1b860175d5cc7a784ee07dcbba152e.png)

All four posts are published.

So I expect to see all four of them on my website when calling this partial. However, I’m getting this as a result:

 ![Screenshot from 2020-04-19 19-14-23@2x](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/8/8cdc58f567af85837c7f23420dd23da28ea1b634.jpeg)

That’s just the first two results. There should also be top 16 of 2016 and top 15 of 2015 there.

What am I doing wrong?

home.hbs that loads the partial, in case it’s of any help:

```auto
{{!< default}}
{{> "featuredPosts"}}
{{> "latestPost"}}

<div id="main">
    <div class="container">
        <h2 class="homepage-section-title">Posts</h2>
        <div class="row">
            {{> "postLoop"}}
        </div>
    </div>
    <div class="container">
        <h2 class="homepage-section-title">Pages</h2>
        <div class="row">
            {{> "pageLoop" }}
        </div>
    </div>
    <div class="container">
        <h2 class="homepage-section-title">Music</h2>
        <div class="row">
            {{> "musicLoop" }}
        </div>
    </div>
</div>

{{pagination}}

```

---

<div class="post-metadata">

**Author:** ![Kevin](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kevin/32/32_2.png) [@Kevin](https://forum.ghost.org/u/Kevin)\
**Post date:** [April 19, 2020, 9:16pm UTC](https://forum.ghost.org/t/has-helper-doesnt-return-all-the-posts-with-a-tag/13672/2 "2020-04-19T21:16:23Z")

</div>

`{{#foreach posts}}` will only loop over the posts displayed on the current page.

If you’re trying to work with content from across the whole site then you’re probably looking for the `{{#get}}` helper.

> **[Ghost Handlebars Theme Helpers: get](https://ghost.org/docs/themes/helpers/get/)**
>
> Make custom queries to the Ghost API using the get helper and fetch publicly available data. Read more about Ghost themes! 👻

---

<div class="post-metadata">

**Author:** ![r3bl](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/r3bl/32/5009_2.png) [@r3bl](https://forum.ghost.org/u/r3bl)\
**Post date:** [April 20, 2020, 10:06am UTC](https://forum.ghost.org/t/has-helper-doesnt-return-all-the-posts-with-a-tag/13672/3 "2020-04-20T10:06:25Z")

</div>

Yup, replacing the partial with:

```auto
{{#get "posts" filter="tags:music" }}
{{#foreach posts }}
    <div>HTML code here</div>
{{/foreach}}
{{/get}}

...did the trick. Thanks for the tip!
```
