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 : http://galexymobile.com/chipman/

But if you see in category page http://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.

Member Avatar for LastMitch

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.

It's an plugin. If you still have questions post it here:

http://wordpress.org/support/plugin/woocommerce

The reason is very simple it's their product and platform. Someone over there will be more familiar with this.

I hope you understand that.

or you can look at this:

http://wpsnacks.com/wordpress-tutorials/how-to-add-custom-pagination-page-navigation-to-woocommerce/

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.