WordPress.org

Ready to get started?Download WordPress

Forums

Woocommerce Featured Products Paging (2 posts)

  1. sysins
    Member
    Posted 1 year ago #

    Hi All,

    Hope someone can help me with this.
    On the home page of my site I want to show a list of featured products from the catalog.

    So far I have this:

    <div id="content" role="main">
            <ul class="products">
            <?php /*$paged = (get_query_var('page')) ? get_query_var('page') : 1;*/ ?>
            <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>
        	<?php $args = array(
                            'post_type' => 'product',
    						'meta_key' => '_featured',
    						'meta_value' => 'yes',
                            'posts_per_page' => 8,
                            'paged' => $paged); ?>
        	<?php $my_query = new wp_query( $args ); ?>
            <?php if ( $my_query->have_posts() ) {
    				  while ( $my_query->have_posts() ) : $my_query->the_post();
    					  woocommerce_get_template_part( 'content', 'product' );
    				  endwhile;
    			  } else {
    				  echo __( 'No products found' );
    			  } ?>
            </ul><!--/.products-->			
    
    		</div><!-- #content -->

    This does display a list of the featured products but no paging shows up.

    Can anyone tell me where I am going wrong.

    Thanks in advance

  2. retroriff
    Member
    Posted 10 months ago #

    Hi, I am having the same problem. Did you find a solution?

Topic Closed

This topic has been closed to new replies.

About this Topic