Infinite scroll not working – 404 error(?)
-
Hi,
I have a WP Query (see code below), which I am trying to get working with YITH’s infinite scroll. The loading symbol shows up immediately but nothing actually loads. In the console, a 404 error appears when you scroll to where the pagination container is.
I’ve tried with and without the $paged variable, I’ve tried with various different class names, I’ve tried disabling other plugins, and still the issue persists.
Settings screenshot
https://hutchcommunity.co.uk/screenshot.pngCode
<ul class="products product-listing"> <?php global $paged; $paged = (get_query_var('page')) ? get_query_var('page') : 1; $args = array( 'post_type' => 'product', 'posts_per_page' => 3, 'paged' => $paged, ); $loop = new WP_Query($args); if($loop->have_posts()){ while($loop->have_posts()){ $loop->the_post(); wc_get_template_part('content', 'product'); } ?> <nav class="woocommerce-pagination"> <a class="next">Load More</a> </nav><?php }else{ echo __( 'No products found' ); } wp_reset_postdata(); ?> </ul>
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Infinite scroll not working – 404 error(?)’ is closed to new replies.