remove_action('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10);
add_action( 'woocommerce_shop_loop_item_title', 'VS_woo_loop_product_title', 10 );
function VS_woo_loop_product_title() {
$terms = get_the_terms( $post->ID, 'product_cat' );
if ( $terms && ! is_wp_error( $terms ) ) :
// only displayed if the product has at least one category
$cat_links = array();
foreach ( $terms as $term ) {
$cat_links[] = '<a href="'.esc_url( home_url() ).'/kategorie/'.$term->slug.'">'.$term->name.'</a>';
}
$on_cat = join( ", ", $cat_links );
?>
<div class="label-group">
<div class="categories-link"><?php echo $on_cat; ?></div>
</div>
<?php endif;
}
Quelle: https://seom.at/woocommerce-snippets-fuer-die-functions-php-die-dein-webshop-braucht/