• Resolved tdelsack

    (@tdelsack)


    Infinite Scroll has been broken on our site for a while now.

    I can see that JavaScript works, but the site fails to load the posts.

    Here’s my code so far:

    add_theme_support('infinite-scroll', array(
    		'container' 		=> 'infinite-scroll',
    		'render'    		=> 'fralin_render_infinite_posts',
    		'footer'		=> false,
    		'posts_per_page'	=> 12,
    	));
    function fralin_render_infinite_posts() {
    	while (have_posts()) {
    		the_post();
    		get_template_part('template-parts/content', get_post_type());
    	}
    }

    If checking the body class on scroll, you can see that it appends infinity-success to the body, but nothing happens on the wrapper or page. I’ve checked the page source to see if the posts are loaded elsewhere, but I can’t get anywhere with this.

    I’ve also checked the Jetpack Debug page and everything checked out.

    Any ideas?

    Thanks in advance.

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support MadHatter (a11n)

    (@madhattersez)

    Hello, there.

    I do see that you have 45 plugins active, and there could very well be a conflict somewhere in there.

    Would you be able to try disabling all other plugins except for Jetpack and WooCommerce-related functions to see if the issue continues? If everything looks normal while doing so, then you can switch on each other plugin one by one until you see the problem happen again.

    If you still see the issue even with all other plugins disabled, could you also try switching out your theme for a more minimalistic one (such as Twenty Twenty Two) to make sure this isn’t some sort of theme conflict?

    Please let us know the results of the above troubleshooting and we can go from there. Thanks!

    Thread Starter tdelsack

    (@tdelsack)

    I’ve actually done both of those. It’s not a plugin conflict, but if I switch to Twenty Twenty One (not familar with the block layout yet), I can get the click to scroll load more posts working.

    We’re on a completely custom theme, and we don’t have any registered widget areas or anything like that…could that be an issue?

    I’m getting a JS error on Sentry: Sentry Link

    Plugin Support lastsplash (a11n)

    (@lastsplash)

    Hi there –

    I tested this with Twenty Twenty One and also confirmed that it works. I’m not seeing the JS error on Twenty Twenty One. It seems that the issue here is the custom theme that you are using since it works on a default theme.

    Unfortunately, we are unable to help troubleshoot custom-coded themes. We have some documentation here that may help with the issue:

    https://jetpack.com/support/infinite-scroll/

    https://developer.jetpack.com/module/infinite-scroll/

    Thread Starter tdelsack

    (@tdelsack)

    Okay, thanks. What is the correct way for removing infinite scroll altogether and simply displaying all posts?

    Plugin Support lastsplash (a11n)

    (@lastsplash)

    You can disable the Infinite Scroll module in the Jetpack settings. Additionally, if your theme doesn’t opt-in to Infinite Scroll as explained here it won’t load:

    https://jetpack.com/support/infinite-scroll/#theme

    Holkan

    (@cubeinthebox)

    Hello there. Does infinite scroll works for single post templates? I’m trying to implement it, but it seems to only work for archive and tag templates.
    Sorry if this is not on topic, but I didn’t want to open a new issue for such a simple question.
    Thanks in advance!

    Hi @cubeinthebox

    The infinite scroll only works for pages when there are supposed to be a lot of posts showing, so instead of the usual pagination (showing a limited number of posts and then having you jump to the next page to see more), you can scroll and have them load on the same page.

    Feel free to create a thread for your questions ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Infinite Scroll Not Working’ is closed to new replies.