• Resolved wpmhweb

    (@wppit)


    For many years, somehow, I was able to use the HTML selector option to insert an ad inside Li tag, as you see below. It worked great for many years, but after Ad Inserter version 2.7.24, the feature stopped working, meaning that the ad code would be inserted, but ads wouldn’t show.

    Searching around the forum, I found that for the HTML selector work, I needed to use the server-side option with the output buffering. I tried this option, but it seems that it’s not working for me since the Ad Insert plugin tries to add more than one block in random places on the page.

    So, my question is without using the HTML selector and without enabling output buffering, how can I add an ad block inside the LI tag with the available settings in Ad Inserter?

    <ol>
      <li>
       <P>This is the first item in the list.</P>
       <aside>This is Block Ad</aside>
      </li>
      
    
      <li>
        <P>This is the first item in the list.</P>
     </li>
    </ol>
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Spacetime

    (@spacetime)

    You did not provide any details so I can’t check your website.

    There were no changes in the insertion features. Both approaches still work but you need to be careful on selecting the right settings. Make sure a valid HTML selector for the selected method is used:
    https://adinserter.pro/documentation/insertion-before-inside-after-html-element

    Please note that if your selector matches more than one element, then you will have more than one insertion.

    Client-side insertion uses JavaScript to insert the code. For cases with multiple insertions you may have difficulty creating the right selector for the target position. If your website uses jQuery you can try to use pseudo selectors like :eq(n). In such case the plugin will try to use jQuery functions for insertion (of course, only if jQuery library is loaded).

    Server-side insertion in most cases also works fine, but you can’t use complex or pseudo selectors (the plugin depends on a library for this). But you can uses server-side function Filter to limit (or target) insertions:
    https://adinserter.pro/documentation/additional-block-settings#filter

    Thread Starter wpmhweb

    (@wppit)

    Thanks for the reply. I don’t really know what happened, the plugin has been running beautifully for years without any modifications in the settings, but recently I started experiencing the problem I mentioned earlier. I have also found another user in this forum with a similar problem after recent updates.

    Since the impressions were getting affected, I had to remove the previous unit configuration with a after a paragraph configuration until if I could a find a fix, so that’s why I didn’t share more details because I had to remove the configuration that wasn’t working.

    So, I ended up using:

    Insertion, after paragraph 1
    Count, from the top, paragraphs with tags P
    Count only inside OL and check Li

    So far, it appears that it did the trick.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add ad block inside li tag?’ is closed to new replies.