Skip to content

Instantly share code, notes, and snippets.

@frankschrijvers
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frankschrijvers/4bbcf750a2d67b7c43c6 to your computer and use it in GitHub Desktop.
Save frankschrijvers/4bbcf750a2d67b7c43c6 to your computer and use it in GitHub Desktop.
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