[英]Woocommerce how to display products from specific category on archive page
On my archive-product page I want to display some products from a specific category. 我想在归档产品页面上显示特定类别的一些产品。
I tried to do this: 我试图这样做:
echo '<div>';
echo wc_get_product_category_list( 'special_items', $category ));
echo '</div>';
inside the product loop, but it doesn't work. 在产品循环中,但不起作用。
How can I achieve that? 我该如何实现?
In woocommerce some shortcode available. 在woocommerce中,一些短代码可用。 You may call echo do_shortcode in your template files
您可以在模板文件中调用echo do_shortcode
https://docs.woocommerce.com/document/woocommerce-shortcodes/#scenario-5-specific-categories https://docs.woocommerce.com/document/woocommerce-shortcodes/#scenario-5-specific-categories
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.