Infinite Scroll on homepage with latest network post

Hello! :slight_smile:

I want to make my new homepage ( load faster with infinite scroll. I have tried the following tutorial: but I can't get it to work. I want it to load one section at a time, and have replaced the itemselector and content selector, but it doesn't work.

Can anyone help me? All the codes are inserted correct.

  • Mathias
    • The Bug Hunter

    Sure, here:

     * Load javascripts used by the theme
    function custom_theme_js(){
    	wp_register_script( 'infinite_scroll',  get_template_directory_uri() . '/js/jquery.infinitescroll.min.js', array('jquery'),null,true );
    	if( ! is_singular() ) {
    add_action('wp_enqueue_scripts', 'custom_theme_js');
     * Infinite Scroll
    function custom_infinite_scroll_js() {
    	if( ! is_singular() ) { ?>
    	var infinite_scroll = {
    		loading: {
    			img: "<?php echo get_template_directory_uri(); ?>/images/ajax-loader.gif",
    			msgText: "<?php _e( 'Loading the next set of posts...', 'custom' ); ?>",
    			finishedMsg: "<?php _e( 'All posts loaded.', 'custom' ); ?>"
    		"nextSelector":"#nav-below .nav-previous a",
    	jQuery( infinite_scroll.contentSelector ).infinitescroll( infinite_scroll );
    add_action( 'wp_footer', 'custom_infinite_scroll_js',100 );

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.