• Resolved aplusdesign

    (@aplusdesign)


    I’ve been trying to use infinite scroll on my blog, but nothing I do seems to make to it work.

    It is enabled, and under reading settings, I have show 4 posts, and scroll infinitely selected.

    My body class is getting ‘infinite-scroll neverending’ and spin.js, and infinity.css are attached in the head. But I can’t see any js relating to infinity scroll specifically. I assume this is why I get no console errors and nothing seems to happen when scrolling to the end of my posts (there are more than 4 in the blog, and more than 7).

    So my wp theme it would appear is adding Infinite scroll correctly to a point, but not appending the necessary js files (infinity.js)?

    It is a 100% custom built theme, functions.php only consists of built or borrowed custom methods. Currently the blog is in dev on my local, there is no live version up yet.

    Here is how I include jetpack

    function wtdip_infinite_scroll_init() {
        add_theme_support( 'infinite-scroll', array(
            'container' => 'content',
    	'footer'    => 'footer'
        ) );
    }
    add_action( 'after_setup_theme', 'wtdip_infinite_scroll_init' );

    When this is present my theme ignores the reading setting of 4 and spits out 7 posts, just an fyi…

    Can anyone help?

    https://wordpress.org/plugins/jetpack/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter aplusdesign

    (@aplusdesign)

    If I change infinity.php line 333 to

    wp_enqueue_script( 'the-neverending-homepage', plugins_url( 'infinity.js', __FILE__ ), array( 'jquery' ), 20140523 );

    The file gets included.

    This does not solve the problem, because when it initialises the plugin

    if ( 'object' != typeof infiniteScroll )
    		return;

    infiniteScroll is undefined!

    Seriously at a loss, need guidance.

    Thread Starter aplusdesign

    (@aplusdesign)

    Figured it out. Solution.

    Don’t remove

    <?php wp_footer(); ?>

    From your footer.php in your template 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Infinite Scroll, not loading infinity.js’ is closed to new replies.