Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add init infinite scroll
// Add init infinite scroll
add_action( 'wp_footer', 'custom_infinite_scroll_js',100);
function custom_infinite_scroll_js() {
?>
<script>
var infinite_scroll = {
loading: {
msgText: "<?php _e( 'Loading the next set of posts...', 'plastic' ); ?>",
finishedMsg: "<?php _e( 'All posts loaded.', 'plastic' ); ?>"
},
"nextSelector":".pagination-next a",
"navSelector":".pagination",
"itemSelector":".brick",
"contentSelector":"#container",
"behavior": "masonry"
};
jQuery( infinite_scroll.contentSelector ).infinitescroll( infinite_scroll );
</script>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment