Tumblr - load all posts


/ Published in: jQuery
Save to your folder(s)

Very rudimentary script for loading all posts on a tumblr blog at the same time. Needs a lot of work, just a concept really.


Copy this code and paste it in your HTML
  1. //Presumes your posts code is inside a div "#posts" and ".page" inside this.
  2.  
  3. $(document).ready(function() {
  4. var totalPages = $("#hidden_navinfo .totalpages").text();
  5. for ( var i = 1, len = totalPages; i < len; i++) {
  6. var count = i+1;
  7. var new_posts = "";
  8. $.get("/page/" + count, function(data) {
  9. $("#posts").append($('.page', $(data)));
  10. });
  11.  
  12. }
  13. });
  14.  
  15.  
  16. // This needs to go in the the page div
  17. <div id="hidden_navinfo"><span class="totalpages">{TotalPages}</span></div>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.