# {{#foreach posts limit="6"}} not working

**URL:** <https://forum.ghost.org/t/foreach-posts-limit-6-not-working/23924>\
**Category:** Developer help\
**Created:** [July 1, 2021, 8:57pm UTC](https://forum.ghost.org/t/foreach-posts-limit-6-not-working/23924 "2021-07-01T20:57:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![leventdev](https://avatars.discourse-cdn.com/v4/letter/l/8491ac/32.png) [@leventdev](https://forum.ghost.org/u/leventdev)\
**Post date:** [July 1, 2021, 8:57pm UTC](https://forum.ghost.org/t/foreach-posts-limit-6-not-working/23924/1 "2021-07-01T20:57:13Z")

</div>

Hi there,

I added a limit on how many posts should show up on the front page, but for some reason, it’s always twice as much. It worked just fine, until I added a post to be featured and removed it a bit after, but the bug stayed.  
Weirdly, it’s not even the last 12 posts, but the last 6 and another 6 from a bit ago.

---

<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:** [July 2, 2021, 11:13am UTC](https://forum.ghost.org/t/foreach-posts-limit-6-not-working/23924/2 "2021-07-02T11:13:59Z")

</div>

Make sure you use simple quote signs.  
This works:

```auto
{{#foreach posts limit="6"}}

```

This doesn’t:

```auto
{{#foreach posts limit=“6”}}

```

---

<div class="post-metadata">

**Author:** ![leventdev](https://avatars.discourse-cdn.com/v4/letter/l/8491ac/32.png) [@leventdev](https://forum.ghost.org/u/leventdev)\
**Post date:** [July 2, 2021, 1:25pm UTC](https://forum.ghost.org/t/foreach-posts-limit-6-not-working/23924/3 "2021-07-02T13:25:57Z")

</div>

Using the right quote signs. The weird thing is that at first the last 6 posts load, but then after the page loads, the scrollbar doubles in full length, and six more posts appear

---

<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:** [July 2, 2021, 1:31pm UTC](https://forum.ghost.org/t/foreach-posts-limit-6-not-working/23924/4 "2021-07-02T13:31:45Z")

</div>

Does your theme have an infinite scroll script? If it does then it’s likely picking up that the bottom of the posts list is visible and so loading the next page of posts.

---

<div class="post-metadata">

**Author:** ![leventdev](https://avatars.discourse-cdn.com/v4/letter/l/8491ac/32.png) [@leventdev](https://forum.ghost.org/u/leventdev)\
**Post date:** [July 2, 2021, 1:48pm UTC](https://forum.ghost.org/t/foreach-posts-limit-6-not-working/23924/5 "2021-07-02T13:48:56Z")

</div>

Nope, no infinite script. Only have AOS, but everything worked just fine, after we added the animations.
