Support » Plugin: WordPress Infinite Scroll by Auto Load Next Post » Post Navigation Twentyeleven

  • Resolved frgtech

    (@frgtech)


    Hi,
    I’m having trouble getting this to work with my child theme of twentyeleven. Single posts are working fine but my latest posts and archive pages are not working.

    I tried following the documentation and added the supplied javascript to add the rel attribute, (modified slightly for my selectors) but it still doesn’t work.

    functions.php

    function wpb_hook_javascript() {
        ?>
            <script>
    			// Runs on page load, the initial post.
    			jQuery( document ).ready( function() {
        			jQuery( 'div.nav-previous' ).find( 'a' ).attr( 'rel', 'prev' );
    			});
    
    			// Runs once a post has loaded.
    			jQuery('body').on( 'alnp-post-loaded', function( e ) {
        			jQuery( 'div.nav-previous' ).find( 'a' ).attr( 'rel', 'prev' );
    			});
            </script>
        <?php
    }
    add_action('wp_head', 'wpb_hook_javascript');

    This appears to add the relattribute as intended but auto scroll is still not working.

    I’m hoping I am just misunderstanding something simple.
    Any help is most appreciated.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.