Title: Multiple insertion with parallel code changes
Last modified: December 29, 2022

---

# Multiple insertion with parallel code changes

 *  Resolved [pharmanext](https://wordpress.org/support/users/pharmanext/)
 * (@pharmanext)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/multiple-insertion-with-parallel-code-changes/)
 * Hi,
 * I’m asking for your help.
 * I insert the same code every N paragraphs (%N@S).
 *     ```wp-block-code
       <div id=divID_01></div>
       <script>
       ;(function ads(a, b, c) {
         w[c] = w[c] || [];
         w[c].push(function() {
           ads.create({ adID: 123456, divId: 'divID_01' })
         })
       })()
       </script>
       ```
   
 * In this code **adID** is a constant, only the container **divId** changes (it
   should be unique).
 * Yes, there are filters. But there’s a problem with them, and so far I can’t get
   them to work guaranteed.
 * So question: Is there an alternative way to repeatedly insert code with **divId**
   changing in two places at the same time — in the container and in the code itself?
 * The **divId** can be anything random, but every time code is inserted the **divId**
   must be the same in the container and in the code that references the container.
 * Thanks a lot.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/multiple-insertion-with-parallel-code-changes/#post-16329909)
 * Yes, add counter shortcode to the ID as in this example:
   `[ADINSERTER counter
   ="block"]`[https://adinserter.pro/documentation/ad-manager-ads#multiple-ads](https://adinserter.pro/documentation/ad-manager-ads#multiple-ads)

Viewing 1 replies (of 1 total)

The topic ‘Multiple insertion with parallel code changes’ is closed to new replies.

 * ![](https://ps.w.org/ad-inserter/assets/icon-256x256.jpg?rev=1502039)
 * [Ad Inserter - Ad Manager & AdSense Ads](https://wordpress.org/plugins/ad-inserter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ad-inserter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ad-inserter/)
 * [Active Topics](https://wordpress.org/support/plugin/ad-inserter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ad-inserter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ad-inserter/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Spacetime](https://wordpress.org/support/users/spacetime/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/multiple-insertion-with-parallel-code-changes/#post-16329909)
 * Status: resolved