• Resolved Mike

    (@shakingpaper)


    Wondering if there is a method to insert a snippet of code (ad implementation) after every new page load? Currently calling 14 posts and would like to insert the same ad post after the 14 and before the next lot of 14 are loaded.

    https://wordpress.org/plugins/ajax-load-more/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    Hi shakingpaper,
    Have you tried adding it directly to your repeater tmeplate?

    <li>
    <h3><?php the _title(); ?></h3>
    </li>
    <?php
      if($alm_current === 14){
        // Do stuff
      }
    ?>
    Thread Starter Mike

    (@shakingpaper)

    Thanks dcooney!

    I didn’t realise you could add alm conditionals in. That’s perfect.

    hi dcooney, i have similiar problem with shaking paper. but i dont know how to insert this code. i put it after deafult template code.

    <li<?php if (! has_post_thumbnail() ) { echo ‘ class=”no-img”‘; } ?>>
    <?php if ( has_post_thumbnail() ) { the_post_thumbnail(array(150,150));
    }?>
    <h3>” title=”<?php the_title(); ?>”><?php the_title(); ?></h3>
    <p class=”entry-meta”>
    <?php the_time(“F d, Y”); ?>
    </p>
    <?php the_excerpt(); ?>

    • <h3><?php the _title(); ?></h3>
    • <?php
      if($alm_current === 5){
      <img src=”http://www.mysite.com/blablabla.jpg&#8221; alt=”” /> }
      ?>

      but it dont work, i want to show an image after 5 post. i dont have any skill in writting script code. thanks.

    Plugin Author Darren Cooney

    (@dcooney)

    Hi mikataghara,
    What is the issue, the image is not displaying?

    Also, you need to format your code above in a code block so it doesn’t break this page.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Insert code after every x posts?’ is closed to new replies.