Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter Gravel

    (@g22)

    Update,

    I’ve installed the Ajax Pagination and Infinite Scroll plugin and I’m able to get it to work in product categories where pagination seems to be configured :

    https://airsofttrade.ca/product-category/accessories-2/

    I can’t on the homepage I must be missing something in the code here :

    <ul class="products">
    	<?php
    		$args = array(
    			'post_type' => 'product',
    			'posts_per_page' => 12
    			);
    		$loop = new WP_Query( $args );
    		if ( $loop->have_posts() ) {
    			while ( $loop->have_posts() ) : $loop->the_post();
    				wc_get_template_part( 'content', 'product' );
    			endwhile;
    		} else {
    			echo __( 'No products found' );
    		}
    		wp_reset_postdata();
    	?>
    </ul><!--/.products-->

    Thanks

    Plugin Contributor Mike Jolley

    (@mikejolley)

    This is an independent loop so a plugin which adds pagination has nothing to pagination.

    If you want paginated results on the homepage, you might need to set the front page to be ‘shop’ or do pagination with more custom coding after your loop.

    Thread Starter Gravel

    (@g22)

    Hi Mike,

    That looks some kind of complicated and off my knowledge for me ??

    Could you give me a code that I could paste in my homepage that could add pagination?

    Thanks!

    Plugin Contributor Mike Jolley

    (@mikejolley)

    Not really – I don’t have custom code for this to hand.

    Why not set the frontpage (settings > reading) to shop?

    Thread Starter Gravel

    (@g22)

    Hi Mike,

    In the homepage I have a custom layout with a youtube video, featured products and right sidebar I would like to keep.

    Can I copy some code from the shop page to my home page because the shop page works with the ajax plugin I’m using!!?

    My theme’s using a special home page.

    https://airsofttrade.ca

    Thanks!

    Plugin Contributor Mike Jolley

    (@mikejolley)

    No then I don’t think so. This would need to be custom (i.e. telling it the content to load – you have a bog standard loop right now).

    Maybe you can just link to your main shop page instead of paginating.

    Thread Starter Gravel

    (@g22)

    Hi Mike,

    I have this site and another one coming which will face the same problem.

    Could you create that custom code for me for around 30$cad?

    I don’t think the code would take lots of time?

    Let me know!

    Thanks!

    Plugin Contributor Mike Jolley

    (@mikejolley)

    Use jobs.wordpress.net – I cannot do freelance work.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Product page pagination missing or infinite scroll’ is closed to new replies.