-1
woocommerce 제품에 대한 사용자 정의 코드를 생성했습니다. 범주별로 처음 10 개 제품이 표시되지만 두 번째 페이지에서는 동일한 제품이 표시됩니다 (동일한 제품이 표시되는 모든 페이지에도 표시됩니다). rand에 의해 결과가 정확하지만 제목으로 결과를 내 코드에 대한 해결책을 알려주십시오.카테고리별로 woocommerce 제품을 각 페이지에 처음 10 개 제품을 반복하므로 모든 제품을 표시하는 방법은 무엇입니까?
<ul class="products">
<?php $cat_slug=get_queried_object()->slug; ?>
<?php
$args = array('post_type' => 'product', 'product_cat' => $cat_slug, 'orderby' => 'title');
$loop = new WP_Query($args);
while ($loop->have_posts()) : $loop->the_post(); global $product; ?>
<li class="product_cust ">
<div class="woo_100">
<div id="woo_c">
<a href="<?php echo get_permalink($loop->post->ID) ?>" title="<?php echo esc_attr($loop->post->post_title ? $loop->post->post_title : $loop->post->ID); ?>">
<?php woocommerce_show_product_sale_flash($post, $product); ?>
<div class="woo_thumb">
<?php if (has_post_thumbnail($loop->post->ID)) echo get_the_post_thumbnail($loop->post->ID, 'shop_catalog'); else echo '<img src="'.woocommerce_placeholder_img_src().'" alt="Placeholder" width="300px" height="300px" />'; ?>
</div>
</a>
</div>
<div id="woo_d">
<div class="woo_desc">
<div class="nil_desc">
<a href="<?php echo get_permalink($loop1->post->ID) ?>" title="<?php echo esc_attr($loop1->post->post_title ? $loop1->post->post_title : $loop1->post->ID); ?>">
<h3><?php the_title(); ?></h3>
</a>
<span class="price"><?php echo $product->get_price_html(); ?></span><br>
</div>
<div class="nil_cart"><?php woocommerce_template_loop_add_to_cart($loop1->post, $product); ?>
</div>
</div>
</div>
</div>
</li>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
</ul>
감사합니다. –