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
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论