title: Include script in infinite scroll Wordpress Posts
body: <p>We are currently using Ajax infinite scroll for blog posts. But we wanted to included scripts (javascript) on every blogposts. Everything works fine except the script only show once at the very top portion of the blogpost.</p>
  
  <p>here is the snippet for the singles.php loop which has been modified for Ajax infinite scroll standards:
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php while ( have_posts() ) : the_post(); ?&gt;
  &lt;?php if (et_get_option('divi_integration_single_top') &lt;&gt; '' &amp;&amp; et_get_option('divi_integrate_singletop_enable') == 'on') echo(et_get_option('divi_integration_single_top')); ?&gt;
      &lt;?php
      echo do_shortcode('[ajax_load_more cache="true" cache_id="2869844236" cta="true" cta_position="after:1" css_classes="call-to-actions call-to-actions-js" images_loaded="true" post_type="post" repeater="default" previous_post="true" previous_post_id="'. get_the_ID() .'" posts_per_page="1" button_label="Previous Post"]');
      ?&gt;
  
  &lt;?php endwhile; ?&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>and here is the snippet for the repeater template which include a simple script code.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;article id="post-&lt;?php the_ID(); ?&gt;" &lt;?php post_class( 'et_pb_post' ); ?&gt;&gt;
    &lt;script&gt;
      document.write("This text is displayed using a simple javascript.");
    &lt;/script&gt;
    &lt;div class="et_post_meta_wrapper"&gt;
      &lt;h1&gt;&lt;?php the_title(); ?&gt;&lt;/h1&gt;
      &lt;?php the_post_thumbnail('hero', array('alt' =&gt; get_the_title())); ?&gt;
    &lt;/div&gt;
    &lt;div class="entry-content"&gt;
      &lt;?php
      do_action( 'et_before_content' );
  
      the_content();
  
      wp_link_pages( array( 'before' =&gt; '&lt;div class="page-links"&gt;' . esc_html__( 'Pages:', 'Divi' ), 'after' =&gt; '&lt;/div&gt;' ) );
      ?&gt;
    &lt;/div&gt;
  &lt;/article&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Not sure why the script only show once. when I've placed it on the top of the title of each blogposts.</p>