I'm trying to show product parent categories (Just one category not all). Now how can I show the product parent category in woocommerce?
$woocpt_args = [
'post_type' => 'product',
开发者_如何学编程 ];
$woocpt_all_products = new WP_Query( $woocpt_args );
while ( $woocpt_all_products->have_posts() ) : $woocpt_all_products->the_post();
global $product;
echo wc_get_product_category_list(get_the_id());
endwhile;
Can you please be more detailed about this? What do you need to do and you looking for this? I'm asking because I think it's a wrong way to "call" a parent category with your way.
Remember, screenshots and urls always helps a lot the progress of your help you can receive
Friendly, George
精彩评论