title: wordpress ajax pagination breaks after 10 pages
body: <p>Can someone help me with ajax pagination please, i'm on it 2 days already and can't figure it out. I have Load More style pagination, this is the code, preety classic(down below).
  Everything works as planing except when the placeholder reaches page 10. Then, hell break loose and nothing is loading anymore. The button still works untill maxpages is reached and so the button gets removed, but nothing happens with more than 10 placeholders. The website i'm currently using this scriptand the place you can test yourself is this: <a href="http://filmhdonline.com/category/toate-filmele/" rel="nofollow">http://filmhdonline.com/category/toate-filmele/</a>
  I would appreciate someone having an ideea what i'm talking about. Thanks in advance.</p>
  
  <pre><code>jQuery(document).ready(function() {
  
      // The number of the next page to load (/page/x/).
      var pageNum = parseInt(pbd_alp.startPage);
  
      // The maximum number of pages the current query can return.
      var max = parseInt(pbd_alp.maxPages);
  
      // The link of the next page of posts.
      var nextLink = pbd_alp.nextLink; pageNum++;
  
      //Load more videos translation
      var more = pbd_alp.more;
  
      //Loading videos translation
      var loading = pbd_alp.loading;
  
      /**
       * Replace the traditional navigation with our own,
       * but only if there is at least one page of new posts to load.
       */
  
      if(pageNum &lt;= max) {
  
         // Remove the traditional navigation.
          jQuery('.pagination').remove();
  
          // Insert the "More Posts" link.
          if( jQuery('#content').find('ul.listing-videos').length == 1 ){
              jQuery('#content ul.listing-videos').append('&lt;li class="more-posts pbd-alp-placeholder-' + pageNum + '"&gt;&lt;/li&gt;');
              jQuery('#content').append('&lt;p id="pbd-alp-load-posts" class="pagination"&gt;&lt;a href="#"&gt;' + more + '&lt;/a&gt;&lt;/p&gt;');
          }
  
      }
  
  
      /**
       * Load new posts when the link is clicked.
       */
      jQuery('#pbd-alp-load-posts a').click(function() {
  
          // Are there more posts to load?
          if(pageNum &lt;= max) {
  
              // Show that we're working.
              jQuery(this).text(loading);
  
              jQuery('.pbd-alp-placeholder-'+ pageNum).load(nextLink + ' #content ul.listing-videos li',
                  function() {
                      //jQuery('.pbd-alp-placeholder-'+ pageNum).children('li').unwrap();                   
                      console.log(pageNum);
  
                      jQuery(this).children().hide();
  
  
                      $newContent = jQuery(this).children().unwrap();
  
  
                      $newContent.fadeIn('fast');
  
                      // Update page number and nextLink.
                      pageNum++;
                      nextLink = nextLink.replace(/\/page\/[0-9]?/, '/page/'+ pageNum);
  
                      **// Add a new placeholder, for when user clicks again.
                      jQuery('#content ul.listing-videos').append('&lt;li class="more-posts pbd-alp-placeholder-'+ pageNum +'"&gt;&lt;/li&gt;');**
  
                      // Update the button message.
                      if(pageNum &lt;= max) {
                          jQuery('#pbd-alp-load-posts a').text('Vezi mai multe');
                      } else {
                          jQuery('#pbd-alp-load-posts a').remove();
                      }
                  }
              );
          } else {
              jQuery('#pbd-alp-load-posts a').append('.');
          }   
  
          return false;
      });
  });
  </code></pre>