• Resolved webtomeasure

    (@webtomeasure)


    I can’t seem to get Infinite scrolling working on a custom archive page. It seems to me it’s not picking up the arguments from the add_theme_support call. Here’s the code:

    /**
        * Add theme support for infinite scroll.
        *
        * @uses add_theme_support
        * @return void
        */
        function twenty_twelve_infinite_scroll_init() {
        add_theme_support( 'infinite-scroll', array(
            'container'      => 'catalogue-section',
            'render'         => 'my_child_infinite_scroll_render',
            'posts_per_page' => get_option( 'posts_per_page' ),
            'wrapper' => false,
            'type' => 'scroll',
        ) );
        
        }
    
        add_action( 'after_setup_theme', 'twenty_twelve_infinite_scroll_init' );
    
        function my_child_infinite_scroll_render() {
    
        while ( have_posts() ) : the_post(); 
            // Format of a catalogue entry is defined in catalogue-entry.php
            get_template_part( 'catalogue-entry', get_post_type() ); 
        endwhile;
    }

    The layout of the page shows entries from the initial custom posts correctly. However, when the second set of posts is called, it is not formatted correctly, as it’s no longer sitting inside the section that is targetted in my CSS to have multiple columns.

    See the result here: https://www.staging5.shortkidstories.com/story/

    I can see that Infinite Scroll is adding a div around the rendered posts even though in the add theme support call I set wrapper to false:

    <div class="infinite-wrap infinite-view-2" id="infinite-view-2" data-page-num="2" role="region" aria-label="Page: 2.">
    Also it wasn’t picking up my rendering call, so I had to update the default content.php to get the correct format of the entries. I wonder can anyone see why the add_theme_support parameters for infinite scrolling are not being picked up?

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

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

    (@madhattersez)

    Hello, there.

    Layout, design, and custom code are definitely outside the scope of our support since we only develop the Jetpack plugin itself, not WordPress at large – of course, plugins and themes can alter the way infinite scroll and your custom CSS loads. The best options for further help on that would be your webhost, to consult with another developer / designer, or to (hopefully) see if someone else in the community will see your thread and chime in.

    I can at least offer our support page for infinite scroll here for official guidance:

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

    So, we wouldn’t be able to help you with that directly, but I hope this points you in the right direction!

Viewing 1 replies (of 1 total)
  • The topic ‘Jetpack Infinite Scroll problem’ is closed to new replies.