Support » Theme: Primer » Infinite Scroll

  • Resolved jerryrussell

    (@jerryrussell)



    Two things…
    1. I have infinite scroll (via JetPack) disabled on my client’s site because I don’t want it to be universally applied, but I do want it on a couple pages. I do not want it on the page that displays WooCommerce products. I DO want it on the page that displays regular blog posts (a Static page, not the Home page).
    Is there a way to enable infinite scrolling page by page?
    I tried a few plugins, but they caused other problems.

    2. When I DO enable infinite scrolling, it shows up on all archive pages – including Home, and the posts are displayed with transparent backgrounds (no white background behind the post) – so text and images are floating above the dark blue page background color.

    I’m using Primer with a child theme.

    • This topic was modified 7 months, 3 weeks ago by  jerryrussell.
    • This topic was modified 7 months, 3 weeks ago by  jerryrussell.

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @jerryrussell,

    Have you seen our documentation on enabling infinite scroll within Primer?
    https://godaddy.github.io/wp-primer-theme/tutorials-and-examples/tutorials/infinite-scroll-jetpack.html

    Evan

    I have, Evan. Installed the MU plugin php file and re-enabled IS in Jetpack. Same behavior as without MU. Infinite scroll was already an option in JetPack before the MU plugin was added, it just doesn’t function the way I need it to, and it breaks some pages and sliders.

    • This reply was modified 7 months, 3 weeks ago by  jerryrussell.
    • This reply was modified 7 months, 3 weeks ago by  jerryrussell.
    • This reply was modified 7 months, 3 weeks ago by  jerryrussell.

    Do you have still have the MU plugin active? I’d like to see it in action. It sounds like it might be more of a conflict with Jetpack and the slider plugin.

    I just tested the infinite scroll MU plugin we have in that documentation on a fresh Primer install, and it appears to be functioning properly on my end. The only limitation is Jetpack forces the blog posting page to default to showing 10 posts.

    It looks like your using some sort of page builder or something to create the markup for that page.

    In the MU plugin we have provided in the documentation we are using the default .post elements that are generated by the theme. Looking at your markup it looks like your .post container is actually .su-post. I think you also want to update the container in the code to .su-posts-default-loop (assuming you want the infinite scroll to work on the second set of posts you have on the page).

    So in your case, because your markup differs from the base theme, you might want to give the following code a try inside of the MU plugin:

    function primer_infinite_scroll_init() {
    
    	add_theme_support( 'infinite-scroll', array(
    		'container'      => '.su-posts-default-loop',
    		'wrapper'        => '.su-post',
    		'posts_per_page' => 2,
    		'footer_widgets' => array(
    			'footer-1',
    			'footer-2',
    			'footer-3',
    		),
    	) );
    
    }
    add_action( 'after_setup_theme', 'primer_infinite_scroll_init' );

    Thanks, Evan. I disabled the MU Plugin. Trying to disable plugins whenever possible to try to simplify the site. I’ll work out the infinite scrolling some other way.

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