List WooCommerce product Categories

List WooCommerce product Categories WooCommerce support to any WordPress theme:

$args = array(
    'number'     => $number,
    'orderby'    => $orderby,
    'order'      => $order,
    'hide_empty' => $hide_empty,
    'include'    => $ids
);

$product_categories = get_terms( 'product_cat', $args );

$count = count($product_categories);
 if ( $count > 0 ){
     echo "<ul>";
     foreach ( $product_categories as $product_category ) {
       echo '<li><a href="' . get_term_link( $product_category ) . '">' . $product_category->name . '</li>';
        
     }
     echo "</ul>";
 }
See also  Add Content Under “Place Order” Button at WooCommerce Checkout

Leave a Reply

Your email address will not be published. Required fields are marked *