Title: [Plugin: Special Recent Posts] Infinite Scroll
Last modified: August 20, 2016

---

# [Plugin: Special Recent Posts] Infinite Scroll

 *  [tuskmaster](https://wordpress.org/support/users/tuskmaster/)
 * (@tuskmaster)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-special-recent-posts-infinite-scroll/)
 * Is there a way to use the infinite scroll technique with this plugin? It is just
   what I am looking for, but would love to add the infinite scroll functionality.
 * [http://wordpress.org/extend/plugins/special-recent-posts/](http://wordpress.org/extend/plugins/special-recent-posts/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [tuskmaster](https://wordpress.org/support/users/tuskmaster/)
 * (@tuskmaster)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-special-recent-posts-infinite-scroll/#post-3064822)
 * Maybe change something in this code I have for infinite scroll?
 *     ```
       <script type="text/javascript">
           jQuery(document).ready(function($) {
               var count = 2;
               var total = <?php echo $wp_query->max_num_pages; ?>;
               $(window).scroll(function(){
                       if  ($(window).scrollTop() == $(document).height() - $(window).height()){
                          if (count > total){
                          	  	return false;
                          }else{
                          		loadArticle(count);
                          }
                          count++;
                       }
               }); 
   
               function loadArticle(pageNumber){
                       $('a#inifiniteLoader').show('fast');
                       $.ajax({
                           url: "<?php bloginfo('wpurl') ?>/wp-admin/admin-ajax.php",
                           type:'POST',
                           data: "action=infinite_scroll&page_no="+ pageNumber + '&loop_file=loop',
                           success: function(html){
                               $('a#inifiniteLoader').hide('1000');
                               $("#primary").append(html);    // This will be the div where our content will be loaded
                           }
                       });
                   return false;
               }
   
           });
   
       </script>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Special Recent Posts] Infinite Scroll’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/special-recent-posts_006699.svg)
 * [Special Recent Posts](https://wordpress.org/plugins/special-recent-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/special-recent-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/special-recent-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/special-recent-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/special-recent-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/special-recent-posts/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [tuskmaster](https://wordpress.org/support/users/tuskmaster/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-special-recent-posts-infinite-scroll/#post-3064822)
 * Status: not resolved