# Foreach attributes 'from' and 'to' are not targeting my posts

**URL:** <https://forum.ghost.org/t/foreach-attributes-from-and-to-are-not-targeting-my-posts/12194>\
**Category:** Themes\
**Created:** [February 22, 2020, 6:00pm UTC](https://forum.ghost.org/t/foreach-attributes-from-and-to-are-not-targeting-my-posts/12194 "2020-02-22T18:00:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sevsepetjian](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/sevsepetjian/32/6479_2.png) [@sevsepetjian](https://forum.ghost.org/u/sevsepetjian)\
**Post date:** [February 22, 2020, 6:00pm UTC](https://forum.ghost.org/t/foreach-attributes-from-and-to-are-not-targeting-my-posts/12194/1 "2020-02-22T18:00:20Z")

</div>

Hello everyone,

On my dev environment I currently have 10 test posts. When I use the foreach posts from=“2” to=6", my posts will show. However, if I decide to do something like foreach posts from=“7” to=“10” those last few posts will not appear. Anyone have any idea why this is the case?

Thank you!

---

<div class="post-metadata">

**Author:** ![minimaluminium](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/minimaluminium/32/2652_2.png) [@minimaluminium](https://forum.ghost.org/u/minimaluminium)\
**Post date:** [February 23, 2020, 2:10am UTC](https://forum.ghost.org/t/foreach-attributes-from-and-to-are-not-targeting-my-posts/12194/2 "2020-02-23T02:10:07Z")

</div>

👋🏼 Might those posts be subscriber-only posts? If so, you should use `visibility="all"` attribute. `{{#foreach visibility="all" from="7" to="10"}}`

---

<div class="post-metadata">

**Author:** ![sevsepetjian](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/sevsepetjian/32/6479_2.png) [@sevsepetjian](https://forum.ghost.org/u/sevsepetjian)\
**Post date:** [February 23, 2020, 2:35am UTC](https://forum.ghost.org/t/foreach-attributes-from-and-to-are-not-targeting-my-posts/12194/3 "2020-02-23T02:35:34Z")

</div>

Was able to figure it out, I had to wrap the #foreach with a #get which for whatever reason was able to fetch the last few posts.

Ex.  
{{#get “posts” limit=“4” filter=“primary\_tag:test-1” include=“tags”}}  
{{#foreach posts}}  
{{\> “post-card”}}  
{{/foreach}}  
{{/get}}

Thanks for the reply though!
