Title: Server-side Insertion with Filter
Last modified: January 29, 2023

---

# Server-side Insertion with Filter

 *  Resolved [pharmanext](https://wordpress.org/support/users/pharmanext/)
 * (@pharmanext)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/server-side-insertion-with-filter/)
 * Hi,
 * In the general settings, the client-side insertion method is set.
   How can I set
   the server-side method to insert only certain blocks?And that they should be 
   inserted after a certain paragraph number.
 * I know that the server-side method works when using a **Filter**.
 * I should first insert _code-block-nn_ by client-side method into required paragraph
   and then insert _code-block-mm_ by server-side method right after it through **
   Filter**, selecting necessary paragraphs with _code-block-nn_ in their **divs**.
 * So, the client-side method inserts _code-block-1_, _code-block-2_, and code-_block-
   3_ after paragraphs 1, 2, and 3.
   Immediately after these blocks, the corresponding
   blocks _code-block-10_, _code-block-20_, and _code-block-30_ must be inserted
   using the server-side method.In other words, in the following scheme: code-block-
   1 –> code-block-10, code-block-2 –> code-block-20, code-block-3 –> code-block-
   30.
 * The code for the server-side insertion is as follows:
 *     ```wp-block-code
       [ADINSERTER VIEWPORT="Desktop"]
   
       <div>
       <p>--- TEST 1 D ---</p>
       </div>
   
       [ADINSERTER VIEWPORT="Phone"]
   
       <div>
       <p>--- TEST 1 M ---</p>
       </div>
   
       [ADINSERTER COUNT]
   
       [ADINSERTER VIEWPORT="Desktop"]
   
       <div>
       <p>--- TEST 2 D ---</p>
       </div>
   
       [ADINSERTER VIEWPORT="Phone"]
   
       <div>
       <p>--- TEST 2 M ---</p>
       </div>
   
       [ADINSERTER COUNT]
   
       [ADINSERTER VIEWPORT="Desktop"]
   
       <div>
       <p>--- TEST 3 D ---</p>
       </div>
   
       [ADINSERTER VIEWPORT="Phone"]
   
       <div>
       <p>--- TEST 3 M ---</p>
       </div>
       ```
   
 * The paragraph selection settings are the following two to choose from.
 * ![](https://i0.wp.com/i.ibb.co/HKRjJtR/para01.png?ssl=1)
 * ![](https://i0.wp.com/i.ibb.co/2gWq9NH/para02.png?ssl=1)
 * 
   But nothing works, regardless of the **Insert only in the loop** setting.

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/server-side-insertion-with-filter/#post-16418610)
 * Most insertions are done server-side.
 * Dynamic blocks setting is used only for the cases where the checks need to be
   done client-side (e.g. rotation, viewports, clients, cookies,…). The code for
   the checks is still inserted server-side.
 * It makes no sense to define a filter for paragraphs and paragraph numbers at 
   the same time – both do the same. And filter %1 also makes no sense.
 * If you need help for some specific case:
   [https://wordpress.org/support/topic/ad-inserter-support-forum-before-you-ask-for-help/](https://wordpress.org/support/topic/ad-inserter-support-forum-before-you-ask-for-help/)

Viewing 1 replies (of 1 total)

The topic ‘Server-side Insertion with Filter’ 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/)

## Tags

 * [filter](https://wordpress.org/support/topic-tag/filter/)
 * [insertion](https://wordpress.org/support/topic-tag/insertion/)
 * [server-side](https://wordpress.org/support/topic-tag/server-side/)

 * 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/server-side-insertion-with-filter/#post-16418610)
 * Status: resolved