• Theme: _s
    Type: Custom Version.

    I am using customized version of _s where I have Product CPT. In the following files, I need to use Infinite scroll –

    archive-products.php
    taxonomy-[tax-name].php
    home.php
    archive.php

    Now, the problem is most of these templates use custom loop (using WP_Query which ends with pagination after while()).

    I have used following code in functions.php after activating jetpack and Photon module –

    function vg_infinite_scroll_init() {
    	add_theme_support( 'infinite-scroll', array(
    	    'container' => 'page-content',
    	    'footer' => 'page',
    	    'type'   => 'click',
    	    'render'  => false,
    	) );
    }
    
    add_action( 'after_setup_theme', 'vg_infinite_scroll_init' );

    Also, I wrapped all posts under #page-content on archive-products.php. But the infinite scroll is not working either in scroll or in click type. Any ideas?

    https://www.ads-software.com/plugins/jetpack/

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