# Primary\_tag not usable inside #get / #foreach

**URL:** <https://forum.ghost.org/t/primary-tag-not-usable-inside-get-foreach/21754>\
**Category:** Themes\
**Created:** [April 10, 2021, 2:52pm UTC](https://forum.ghost.org/t/primary-tag-not-usable-inside-get-foreach/21754 "2021-04-10T14:52:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jkbecker](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jkbecker/32/12398_2.png) [@jkbecker](https://forum.ghost.org/u/jkbecker)\
**Post date:** [April 10, 2021, 2:52pm UTC](https://forum.ghost.org/t/primary-tag-not-usable-inside-get-foreach/21754/1 "2021-04-10T14:52:35Z")

</div>

Hi!  
I’m working on a “related posts” section in my blog tht is supposed to show a few articles from the same primary tag. To introduce that section I want a section that reads “Read more about \<primary\_tag\>:”.

It seems like when I’m inside the #get context, and/or the #foreach context inside the #get, I don’t have access to the posts’ primary tags? The posts I’m testing this on have primary tags and the #get post filter filters correctly, it’s just inside that I cannot address the primary tag, I’m just getting “Read more about :”.

I must be doing something obvious wrong, this seems pretty basic to me?

```auto
{{#get "posts" filter="primary_tag:{{primary_tag.slug}}+id:-{{id}}" limit="6"}}
    {{#foreach posts}}
        {{#has number="1"}}
        <h3 class="align-center">Read more about <a href="{{primary_tag.url}}">{{primary_tag.name}}</a>:</h3>
        {{/has}}
        <article>
            <h4>{{title}}</4p>
            {{#if feature_image}}
            <img src="{{feature_image}}">
            {{/if}}
        </article>
    {{/foreach}}
{{/get}}

```

---

<div class="post-metadata">

**Author:** ![brightthemes](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/brightthemes/32/25099_2.png) [@brightthemes](https://forum.ghost.org/u/brightthemes)\
**Post date:** [April 10, 2021, 3:27pm UTC](https://forum.ghost.org/t/primary-tag-not-usable-inside-get-foreach/21754/2 "2021-04-10T15:27:09Z")

</div>

By default, the response from the `{{get}}` will only contain base data from post resource.  
You have to use the **include** parameter to load tags (same for authors):

```auto
{{#get "posts" include="tags" filter="primary_tag:{{primary_tag.slug}}+id:-{{id}}" limit="6"}}

```

This way you should have access to the tags within the foreach.

---

<div class="post-metadata">

**Author:** ![tdominey](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/tdominey/32/18521_2.png) [@tdominey](https://forum.ghost.org/u/tdominey)\
**Post date:** [December 1, 2022, 5:33pm UTC](https://forum.ghost.org/t/primary-tag-not-usable-inside-get-foreach/21754/3 "2022-12-01T17:33:03Z")

</div>

This was driving me nuts - thanks bironthemes!
