• I’m trying to use ALM and AdInserter. AdInserter is set to load an ad after posts 2 and 4. However, when I’m debuggin with AdInserter it only shows the initial page as having post counts. I believe this is because ALM isn’t calling The_POST() which is what its using to count/determine that particular insertion point.

    My repeater template looks like the following at the moment:

    <p class="entry-meta"><?php the_time("F d, Y"); ?></p>
    <div class="inside-article">
    <?php if (! has_post_thumbnail() ) { echo ' class="no-img"'; } ?>
       <?php if ( has_post_thumbnail() ) {?>
    <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('full'); ?></a>
       <?php }?> 
    	<div class="entry-summary" itemprop="Text">
    	<p>
       <?php the_excerpt();
    	     ?>
        </p>
    	</div>
    
       <footer class="entry-meta">
    				<span class="comments-link"><span class="gp-icon icon-comments"><svg viewBox="0 0 512 512" aria-hidden="true" role="img" version="1.1" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink" width="1em" height="1em">
    						<path d="M132.838 329.973a435.298 435.298 0 0 0 16.769-9.004c13.363-7.574 26.587-16.142 37.419-25.507 7.544.597 15.27.925 23.098.925 54.905 0 105.634-15.311 143.285-41.28 23.728-16.365 43.115-37.692 54.155-62.645 54.739 22.205 91.498 63.272 91.498 110.286 0 42.186-29.558 79.498-75.09 102.828 23.46 49.216 75.09 101.709 75.09 101.709s-115.837-38.35-154.424-78.46c-9.956 1.12-20.297 1.758-30.793 1.758-88.727 0-162.927-43.071-181.007-100.61z" fill-rule="nonzero"></path>
    						<path d="M383.371 132.502c0 70.603-82.961 127.787-185.216 127.787-10.496 0-20.837-.639-30.793-1.757-38.587 40.093-154.424 78.429-154.424 78.429s51.63-52.472 75.09-101.67c-45.532-23.321-75.09-60.619-75.09-102.79C12.938 61.9 95.9 4.716 198.155 4.716 300.41 4.715 383.37 61.9 383.37 132.502z" fill-rule="nonzero"></path>

    And I’m using the following shortcode, i’ve tried it both inside and outside the loop on my index.php page (using generatepress theme):

    <?php 
    echo do_shortcode('[ajax_load_more id="6618441942" post_type="post" posts_per_page="6" post_format="standard" images_loaded="true" offset="6"]'); ?>
Viewing 3 replies - 16 through 18 (of 18 total)
  • OK, it seems I can answer the question – automatic insertion works fine.

    The easiest way to visualize insertion positions is to enable Show positions debugging function in Ad Inserter.

    I can see that each ALM Ajax call loads 5 post excerpts so you have available positions Before and After Excerpt:
    https://adinserter.pro/documentation/automatic-insertion

    You can use filter to limit insertions:
    https://adinserter.pro/documentation/additional-block-settings#filter

    After I scroll the page down another 5 excerpts are loaded.

    It also seems that HTML tags are stripped from the exceptrs so insertion inside doesn’t make sense.

    Anyway, they are short excerpts and you can easily insert between them (for example using After excerpt insertion and Filter set to 2, 4).

    Thread Starter keywerd

    (@keywerd)

    @spacetime @dcooney I can confirm that the after excerpt insertion point would work. It’s not ideal because it splits up pieces of the post (either puts the comments button after the ad slot or puts the ad between the image and my ‘likebtn’, which i might be able to fix with other css customizations); however, it does appear to work.

    It would be great in the future if you all could get the ‘between post’ trigger point working. Thanks both for your help.

    Insertion inside works, please see my reply above.

    You would need to prevent stripping HTML tags inside excerpts to make it usable.

    However, this is beyond the purpose of the excerpt.

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘Ad Inserter not detecting posts’ is closed to new replies.