# Post offset in Ghost

**URL:** <https://forum.ghost.org/t/post-offset-in-ghost/28448>\
**Category:** Developer help\
**Created:** [February 10, 2022, 12:33pm UTC](https://forum.ghost.org/t/post-offset-in-ghost/28448 "2022-02-10T12:33:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![andy01](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@andy01](https://forum.ghost.org/u/andy01)\
**Post date:** [February 10, 2022, 12:33pm UTC](https://forum.ghost.org/t/post-offset-in-ghost/28448/1 "2022-02-10T12:33:01Z")

</div>

Hi! I like to know if the post offset is possible in ghost, and if it is, then how? Like when I get first five posts, I like to add a CTA between and then continue the posts from the sixth ( first five above the cta, and continue from the sixth post after the CTA).  
PLEASE HELP!

---

<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 11, 2022, 7:55am UTC](https://forum.ghost.org/t/post-offset-in-ghost/28448/2 "2022-02-11T07:55:29Z")

</div>

Hey @andy01,

You’d might like to use `limit` and `from` attribute of `{{#foreach}}` helper to achieve this. More info [here](https://ghost.org/docs/themes/helpers/foreach/#the-limit-attribute).

```plaintext
{{#get "posts"}}
  {{#foreach posts limit="5"}}
    ...
  {{/foreach}}
  
  CTA

  {{#foreach from="6"}}
    ...
  {{/foreach}}
{{/get}}

```

Or you could also use a combination of `{{#has}}` helper and `number` data variable inside the loop. More info [here](https://ghost.org/docs/themes/helpers/foreach/#data-variables).

```plaintext
{{#foreach posts}}
  {{#has number="6"}}
    CTA
  {{/has}}
  ...
{{/foreach}}

```

---

<div class="post-metadata">

**Author:** ![andy01](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@andy01](https://forum.ghost.org/u/andy01)\
**Post date:** [February 11, 2022, 8:15am UTC](https://forum.ghost.org/t/post-offset-in-ghost/28448/3 "2022-02-11T08:15:07Z")

</div>

Thank you @minimaluminium , since I am new to the Ghost Platform, I was confused about the concepts in Theme Development documentation. But can you please explain the difference between `{{#foreach}}` helper and the `{{#has}}` helper, like when to use which?

---

<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 11, 2022, 8:25am UTC](https://forum.ghost.org/t/post-offset-in-ghost/28448/4 "2022-02-11T08:25:49Z")

</div>

Those helpers are different from each other and one doesn’t replace the another. The both solutions above use `{{#foreach}}` helper.

{{#foreach}} - Loop helper which is used for iterate over a list of posts

{{#has}} - This is similar to {{#if}} helper which allows testing conditionals. The difference is it can test more than boolean, `number` data variable in this case.

---

<div class="post-metadata">

**Author:** ![andy01](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@andy01](https://forum.ghost.org/u/andy01)\
**Post date:** [February 11, 2022, 8:28am UTC](https://forum.ghost.org/t/post-offset-in-ghost/28448/5 "2022-02-11T08:28:53Z")

</div>

Oh, I get it now, Thanks for you help!
