Support » Plugin: Infinite-Scroll » [Plugin: Infinite-Scroll] Infinite is Removing custom javascript from content.php file (v. 2.0b2.120

  • Hi,

    I managed to get the plugin to work with my custom them but it seems that when the infinite scroll is initiated it removes the custom addthis javascript code I added to the content.php file of my theme.

    This is the addthis code that I added to the content.php file:

    <!-- AddThis Button BEGIN -->
                <div class="addthis_toolbox addthis_default_style ">
                <a class="addthis_button_tweet" tw:count="vertical"></a>
                <a class="addthis_button_facebook_like" fb:like:layout="box_count"></a>
                <a class="addthis_button_google_plusone" g:plusone:size="tall" ></a>
                </div>
                <script type="text/javascript">
    
    			var addthis_config = {
                "data_track_addressbar":true,
                addthis:url="<?php the_permalink(); ?>",
                addthis:title="<?php the_title(); ?>",
                addthis:description="<?php the_excerpt(); ?>"
                };
    
                </script>
    
                <script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=username"></script>

    But when I load the posts page, only the initial visible posts have the above javascript included. Every post listing after the infinite scroll is loaded is removed from the post listing. The html portion of the custom code is still there, just the javascript is gone.

    How to allow my custom code to function with the infinite scroll is enabled?

    Thank you

    http://wordpress.org/extend/plugins/infinite-scroll/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Same problem. Infinite-Scroll removes all custom javascript…

    Have you tried adding :

    addthis.toolbox('.addthis_toolbox');
              addthis.counter('.addthis_counter');
              addthis.init();

    or something similar in Infinite Scroll’s “Javascript to be called after the next posts are fetched” under settings?

    Hi Mr.Perterman, thanks that did the trick!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Infinite-Scroll] Infinite is Removing custom javascript from content.php file (v. 2.0b2.120’ is closed to new replies.