Woocommerce Products show on homepage with pagination.
-
Hi,
I need help. Me wrote query in my wordpress theme to fetch latest products. Everything is working perfect. But don’t know why pagination not working. I did select 9 post in backend. it’s appear 9 on my home page. But i want to show all products on homepage with pagination.Here is my homepage url : https://galexymobile.com/chipman/
But if you see in category page https://galexymobile.com/chipman/?product_cat=musicians pagination working fine.
Here is my homepage code.
Pliz let me know where is the problem:
<div class="products"> <?php // Setup your custom query $args = array( 'post_type' => 'product', ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); ?> <div class="pro-item"> <div class="pro-item-title"><a>post->ID ) ?>"><?php the_title(); ?></a></div> <div class="pro-item-content"> <div class="pro-item-image"> <a>post->ID ) ?>"> <?php if(has_post_thumbnail()) { the_post_thumbnail($size); } ?> <?php global $more; $more = 0; ?> </a></div><div class="pro-item-desc"><?php the_content(); ?>Price : $<?php echo get_post_meta($post->ID, "_regular_price", $single = true); ?></div><div class="pro-item-btn"> <?php do_action( 'woocommerce_after_shop_loop_item' ); ?> </div> </div></div> <?php endwhile; wp_pagenavi(); // Remember to reset ?> </div>
Can anyone recode and replace his code again. I really need this.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Woocommerce Products show on homepage with pagination.’ is closed to new replies.