You must first find where the <div class="entry-content"> . this is in your wp-content/themes/[themename] in the index.php or loop.php file. after closing </div> contents of the entry, add:
<div class="moreposts" style="display:none" onclick="$('div.moreposts').slideUp();$(document).trigger('retrieve.infscr');"> Show more </div> <script> $(document).ajaxError(function(e,xhr,opt){ if (xhr.status == 404) $('div.moreposts').slideUp("normal", function() { $(this).remove(); } ); }); </script>
Now, in the infinite scroll configuration (Wordpress Admin -> Settings -> Infinite scroll), add this to the "Javascript to call after the following message" field:
$(window).unbind('.infscr'); setTimeout("$('div.moreposts').slideDown();", 1000);
Finally, create a button to make it look beautiful (add to style.css):
.moreposts { display:block; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px; border: 1px solid #ddd; background: #efefef; text-align: center; font-weight: bold; box-shadow: 2px 2px 2px rgba(50,50,50,0.4); color: #444; text-decoration: none; padding: 5px; margin-bottom: 20px; cursor: pointer; } .moreposts:hover { background: #dfdfdf; color: #222; }
Please note that this will be the first automatic message download and subsequent instructions. It is necessary for the script to automatically hide the Forward / Next buttons.
source share