Functie pentru afisarea descrierii unei categorii de Woocommerce dupa afisarea produselor din aceea categorie.
function wpb_add_post_terms() {
global $post;
$args = array(
'taxonomy' => 'product_cat'
);
$terms = wp_get_post_terms($post->ID, 'product_cat', $args);
$count = count($terms);
if ($count > 0) {
foreach ($terms as $term) {
echo '<div class="cat-area">';
echo $term->description;
echo '</div>';
}
}
}
add_action( 'woocommerce_after_shop_loop', 'wpb_add_post_terms', 10 );