# How to put an add every 2 posts?

**URL:** https://meta.discourse.org/t/how-to-put-an-add-every-2-posts/278826
**Category:** Development
**Created:** [September 13, 2023, 6:34am UTC](https://meta.discourse.org/t/how-to-put-an-add-every-2-posts/278826 "2023-09-13T06:34:29Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [September 13, 2023, 8:11am UTC](https://meta.discourse.org/t/how-to-put-an-add-every-2-posts/278826/5 "2023-09-13T08:11:29Z")

</div>

Hi Shatabdi,

Your code is not the proper way to do this, as Discourse dynamically adds posts when you scroll. You’d need to use at least Discourse Javascript API for this, and maybe a plugin, depending on what you want to achieve _exactly_.

Did you try [Discourse Advertising Plugin (Ads)](https://meta.discourse.org/t/discourse-advertising/33734)? This plugin may do what you need, and then you won’t have to develop your own plugin.

---

_[View the full topic](https://meta.discourse.org/t/how-to-put-an-add-every-2-posts/278826)._
